summaryrefslogtreecommitdiffstats
path: root/libkipi/libkipi
diff options
context:
space:
mode:
Diffstat (limited to 'libkipi/libkipi')
-rw-r--r--libkipi/libkipi/Doxyfile1099
-rw-r--r--libkipi/libkipi/KDStream.cpp1086
-rw-r--r--libkipi/libkipi/KDStream.h375
-rw-r--r--libkipi/libkipi/KDTools-License-US138
-rw-r--r--libkipi/libkipi/KDTools-License-non-US93
-rw-r--r--libkipi/libkipi/LICENSE.GPL349
-rw-r--r--libkipi/libkipi/Makefile.am33
-rw-r--r--libkipi/libkipi/banner_left.pngbin0 -> 3024 bytes
-rw-r--r--libkipi/libkipi/batchprogressdialog.cpp224
-rw-r--r--libkipi/libkipi/batchprogressdialog.h80
-rw-r--r--libkipi/libkipi/design96
-rw-r--r--libkipi/libkipi/hi16-app-kipi.pngbin0 -> 918 bytes
-rw-r--r--libkipi/libkipi/hi22-app-kipi.pngbin0 -> 1440 bytes
-rw-r--r--libkipi/libkipi/hi32-app-kipi.pngbin0 -> 2337 bytes
-rw-r--r--libkipi/libkipi/hi48-app-kipi.pngbin0 -> 4072 bytes
-rw-r--r--libkipi/libkipi/imagecollection.cpp262
-rw-r--r--libkipi/libkipi/imagecollection.h76
-rw-r--r--libkipi/libkipi/imagecollectionselector.cpp348
-rw-r--r--libkipi/libkipi/imagecollectionselector.h81
-rw-r--r--libkipi/libkipi/imagecollectionshared.cpp116
-rw-r--r--libkipi/libkipi/imagecollectionshared.h68
-rw-r--r--libkipi/libkipi/imagedialog.cpp327
-rw-r--r--libkipi/libkipi/imagedialog.h83
-rw-r--r--libkipi/libkipi/imageinfo.cpp169
-rw-r--r--libkipi/libkipi/imageinfo.h82
-rw-r--r--libkipi/libkipi/imageinfoshared.cpp120
-rw-r--r--libkipi/libkipi/imageinfoshared.h91
-rw-r--r--libkipi/libkipi/interface.cpp221
-rw-r--r--libkipi/libkipi/interface.h94
-rw-r--r--libkipi/libkipi/kipi-plugins_logo.pngbin0 -> 2572 bytes
-rw-r--r--libkipi/libkipi/kipiplugin.desktop67
-rw-r--r--libkipi/libkipi/libkipi_export.h.in37
-rw-r--r--libkipi/libkipi/mainpage.cpp100
-rw-r--r--libkipi/libkipi/plugin.cpp91
-rw-r--r--libkipi/libkipi/plugin.h76
-rw-r--r--libkipi/libkipi/pluginloader.cpp388
-rw-r--r--libkipi/libkipi/pluginloader.h102
-rw-r--r--libkipi/libkipi/uploadwidget.cpp209
-rw-r--r--libkipi/libkipi/uploadwidget.h75
-rw-r--r--libkipi/libkipi/version.h31
40 files changed, 6887 insertions, 0 deletions
diff --git a/libkipi/libkipi/Doxyfile b/libkipi/libkipi/Doxyfile
new file mode 100644
index 0000000..f9e258e
--- /dev/null
+++ b/libkipi/libkipi/Doxyfile
@@ -0,0 +1,1099 @@
+# Doxyfile 1.3.5
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = libKipi
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY =
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch,
+# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en
+# (Japanese with English messages), Korean, Norwegian, Polish, Portuguese,
+# Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# This tag can be used to specify the encoding used in the generated output.
+# The encoding is not always determined by the language that is chosen,
+# but also whether or not the output is meant for Windows or non-Windows users.
+# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES
+# forces the Windows encoding (this is the default for the Windows binary),
+# whereas setting the tag to NO uses a Unix-style encoding (the default for
+# all platforms other than Windows).
+
+USE_WINDOWS_ENCODING = NO
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is used
+# as the annotated text. Otherwise, the brief description is used as-is. If left
+# blank, the following values are used ("$name" is automatically replaced with the
+# name of the entity): "The $name class" "The $name widget" "The $name file"
+# "is" "provides" "specifies" "contains" "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF =
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited
+# members of a class in the documentation of that class as if those members were
+# ordinary class members. Constructors, destructors and assignment operators of
+# the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. It is allowed to use relative paths in the argument list.
+
+STRIP_FROM_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like the Qt-style comments (thus requiring an
+# explicit @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member
+# documentation.
+
+DETAILS_AT_TOP = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 8
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources
+# only. Doxygen will then generate output that is more tailored for Java.
+# For instance, namespaces will be presented as packages, qualified scopes
+# will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = NO
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text.
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ./
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp
+# *.h++ *.idl *.odl *.cs *.php *.php3 *.inc
+
+FILE_PATTERNS = *.cpp \
+ *.h
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories
+# that are symbolic links (a Unix filesystem feature) are excluded from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories.
+
+EXCLUDE_PATTERNS =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+
+INPUT_FILTER =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default)
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES (the default)
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = YES
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = YES
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_PREDEFINED tags.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed.
+
+PREDEFINED =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse the
+# parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::addtions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or
+# super classes. Setting the tag to NO turns the diagrams off. Note that this
+# option is superseded by the HAVE_DOT option below. This is only a fallback. It is
+# recommended to install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS = YES
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = YES
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = YES
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will
+# generate a call dependency graph for every global function or class method.
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command.
+
+CALL_GRAPH = YES
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found on the path.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_WIDTH = 800
+
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_HEIGHT = 600
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes that
+# lay further from the root node will be omitted. Note that setting this option to
+# 1 or 2 may greatly reduce the computation time needed for large code bases. Also
+# note that a graph may be further truncated if the graph's image dimensions are
+# not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT).
+# If 0 is used for the depth value (the default), the graph is not depth-constrained.
+
+MAX_DOT_GRAPH_DEPTH = 0
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::addtions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/libkipi/libkipi/KDStream.cpp b/libkipi/libkipi/KDStream.cpp
new file mode 100644
index 0000000..aef327f
--- /dev/null
+++ b/libkipi/libkipi/KDStream.cpp
@@ -0,0 +1,1086 @@
+/* -*- Mode: C++ -*-
+ KD Tools - a set of useful widgets for Qt
+ $Id: KDStream.cpp 445690 2005-08-11 17:01:49Z toma $
+*/
+
+/****************************************************************************
+** Copyright (C) 2001-2005 Klarlvdalens Datakonsult AB. All rights reserved.
+**
+** This file is part of the KD Tools library.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid commercial KD Tools licenses may use this file in
+** accordance with the KD Tools Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** Contact info@klaralvdalens-datakonsult.se if any conditions of this
+** licensing are not clear to you.
+**
+**********************************************************************/
+
+#if defined KDAB_EVAL
+#include "../evaldialog/evaldialog.h"
+#endif
+
+#include "KDStream.h"
+#include <qcolor.h>
+#include <qpalette.h>
+#include <qcursor.h>
+#include <qdatetime.h>
+#include <qfont.h>
+#include <qpen.h>
+#include <qpoint.h>
+#include <qsize.h>
+#include <qrect.h>
+#include <qregion.h>
+#include <qobject.h>
+#include <qstringlist.h>
+#include <qmetaobject.h>
+#include <qvariant.h>
+#include <qpointarray.h>
+#include <qsizepolicy.h>
+#include <qbitarray.h>
+#include <qstrlist.h>
+
+#if (QT_VERSION >= 300 )
+#include <qkeysequence.h>
+#include <qpixmap.h>
+#include <qimage.h>
+#endif
+
+/**
+ \file KDStream.cpp
+ \class KDStream KDStream.h
+ \brief Streaming operators for Qt classes.
+
+ When debugging Qt programs the streaming operators in this class offers
+ facilities for printing out values of a number of Qt classes.
+
+ Example:
+ \code
+ QPoint point(10,20);
+ QString string("A test");
+ QFont font = qApp->font();
+ KDStream() << "the point is " << point << ", the string is " << string << ", the font is " << font << endl;
+ \endcode
+*/
+
+
+/*!
+ Creates a KDStream object.
+*/
+KDStream::KDStream( QString* outputString ) :_out(outputString)
+{
+#if defined KDAB_EVAL
+ EvalDialog::checkEvalLicense( "KD Tools" );
+#endif
+
+}
+
+
+/*!
+ Flushes the data to the stream and destroys the KDStream object.
+*/
+KDStream::~KDStream()
+{
+ flush();
+}
+
+
+/*!
+ Flushes buffered data to the stream.
+*/
+void KDStream::flush()
+{
+ if ( _output.isEmpty() )
+ return;
+
+ if ( _out )
+ *_out += _output;
+ else
+ qDebug( "%s", _output.local8Bit().data() );
+ _output = QString();
+}
+
+
+/*!
+ Writes a boolean value to the stream. The value will be represented
+ as either "true" or "false".
+*/
+KDStream& KDStream::operator<<( bool b )
+{
+ _output += ( b ? QString::fromLatin1("true") : QString::fromLatin1("false") );
+ return *this;
+}
+
+/*!
+ Writes a character value to the stream.
+*/
+KDStream& KDStream::operator<<( char ch )
+{
+ _output += QString::fromLatin1("%1").arg( ch );
+ return *this;
+}
+
+
+/*!
+ Writes a floating point value to the stream.
+*/
+KDStream& KDStream::operator<<( float num )
+{
+ _output += QString::number( num );
+ return *this;
+}
+
+
+/*!
+ Writes a double-precision floating point value to the stream.
+*/
+KDStream& KDStream::operator<<( double num )
+{
+ _output += QString::number( num );
+ return *this;
+}
+
+
+/*!
+ Writes a short value to the stream.
+*/
+KDStream& KDStream::operator<<( short num )
+{
+ _output += QString::number( num );
+ return *this;
+}
+
+/*!
+ Writes an unsigned short value to the stream.
+*/
+KDStream& KDStream::operator<<( unsigned short num )
+{
+ _output += QString::number( num );
+ return *this;
+}
+
+/*!
+ Writes an int value to the stream.
+*/
+KDStream& KDStream::operator<<( int num )
+{
+ _output += QString::number( num );
+ return *this;
+}
+
+/*!
+ Writes an unsigned int value to the stream.
+*/
+KDStream& KDStream::operator<<( unsigned int num )
+{
+ _output += QString::number( num );
+ return *this;
+}
+
+/*!
+ Writes a long value to the stream.
+*/
+KDStream& KDStream::operator<<( long num )
+{
+ _output += QString::number( num );
+ return *this;
+}
+
+/*!
+ Writes an unsigned long value to the stream.
+*/
+KDStream& KDStream::operator<<( unsigned long num )
+{
+ _output += QString::number( num );
+ return *this;
+}
+
+/*!
+ Writes a C-style string to the stream.
+*/
+KDStream& KDStream::operator<<( const char* ch )
+{
+ *this << QString::fromLocal8Bit( ch );
+ return *this;
+}
+
+/*!
+ Writes a pointer to the stream. The format is platform-dependent and
+ defined by fprintf( ..., "%p" ).
+*/
+KDStream& KDStream::operator<<( const void* p)
+{
+ _output += QString().sprintf("%p",p);
+ return *this;
+}
+
+
+/*!
+ Writes a QString value to the stream.
+*/
+KDStream& KDStream::operator<<( const QString& str )
+{
+ int index = str.findRev( '\n' );
+ if ( index == -1 )
+ _output += str;
+ else {
+ _output += str.left( index ) + '\n';
+ flush();
+ _output += str.mid( index+1 );
+ }
+ return *this;
+}
+
+/*!
+ Writes a QCString value to the stream.
+*/
+KDStream& KDStream::operator<<( const QCString& str )
+{
+ *this << QString( str );
+ return *this;
+}
+
+
+/*!
+ Runs a stream-processing function on the stream.
+*/
+KDStream& KDStream::operator<<( KDSTREAMFUNC func )
+{
+ return (*func)(*this);
+}
+
+/*!
+ Writes a line terminator to the stream.
+*/
+KDStream& endl( KDStream& stream)
+{
+ stream << QString::fromLatin1("\n");
+ stream.flush();
+ return stream;
+}
+
+/*!
+ Flushes the output buffers.
+*/
+KDStream& flush( KDStream& stream)
+{
+ stream.flush();
+ return stream;
+}
+
+/*!
+ Writes a QChar value to the stream.
+*/
+KDStream& KDStream::operator<<( const QChar& ch )
+{
+ _output += QString( ch );
+ return *this;
+}
+
+
+/*!
+ Writes a QColor value to the stream. See \ref QColor2Str for a
+ description of the output format.
+*/
+KDStream& KDStream::operator<<( const QColor& col )
+{
+ _output += QColor2Str( col );
+ return *this;
+}
+
+/*!
+ Writes a QColorGroup value to the stream. Each color role output
+ with its name and the corresponding color value.
+*/
+KDStream& KDStream::operator<<( const QColorGroup& colgrp )
+{
+ _output +=
+ QString::fromLatin1("foreground: ") + QColor2Str(colgrp.foreground()) + QString::fromLatin1(", ") +
+ QString::fromLatin1("button: ") + QColor2Str(colgrp.button()) + QString::fromLatin1(", ") +
+ QString::fromLatin1("light: ") + QColor2Str(colgrp.light()) + QString::fromLatin1(", ") +
+ QString::fromLatin1("dark: ") + QColor2Str(colgrp.dark()) + QString::fromLatin1(", ") +
+ QString::fromLatin1("mid: ") + QColor2Str(colgrp.mid()) + QString::fromLatin1(", ") +
+ QString::fromLatin1("text: ") + QColor2Str(colgrp.text()) + QString::fromLatin1(", ") +
+ QString::fromLatin1("base: ") + QColor2Str(colgrp.base()) + QString::fromLatin1(", ") +
+ QString::fromLatin1("background: ") + QColor2Str(colgrp.background()) + QString::fromLatin1(", ") +
+ QString::fromLatin1("midlight: ") + QColor2Str(colgrp.midlight()) + QString::fromLatin1(", ") +
+ QString::fromLatin1("brightText: ") + QColor2Str(colgrp.brightText()) + QString::fromLatin1(", ") +
+ QString::fromLatin1("buttonText: ") + QColor2Str(colgrp.buttonText()) + QString::fromLatin1(", ") +
+ QString::fromLatin1("shadow: ") + QColor2Str(colgrp.shadow()) + QString::fromLatin1(", ") +
+ QString::fromLatin1("highlight: ") + QColor2Str(colgrp.highlight()) + QString::fromLatin1(", ") +
+ QString::fromLatin1("highlightedText: ") + QColor2Str(colgrp.highlightedText());
+ return *this;
+}
+
+/*!
+ Writes a QPalette value to the stream. Each color group is output
+ with its role and the corresponding QColorGroup value.
+*/
+KDStream& KDStream::operator<<( const QPalette& palette )
+{
+ *this << QString::fromLatin1("active: ") << palette.active() << endl
+ << QString::fromLatin1("inactive: ") << palette.inactive() << endl
+ << QString::fromLatin1("diabled: ") << palette.disabled();
+
+ return *this;
+}
+
+/*!
+ Writes a QCursor value to the stream. Each cursor is output with its
+ name as listed in the \a QCursor reference documentation.
+*/
+KDStream& KDStream::operator<<( const QCursor& cursor )
+{
+
+ QString type;
+ switch ( cursor.shape() ) {
+#if ( QT_VERSION < 300 )
+ case ArrowCursor: type = QString::fromLatin1("ArrowCursor"); break;
+ case UpArrowCursor: type = QString::fromLatin1("UpArrowCursor"); break;
+ case CrossCursor: type = QString::fromLatin1("CrossCursor"); break;
+ case WaitCursor: type = QString::fromLatin1("WaitCursor"); break;
+ case IbeamCursor: type = QString::fromLatin1("IbeamCursor"); break;
+ case SizeVerCursor: type = QString::fromLatin1("SizeVerCursor"); break;
+ case SizeHorCursor: type = QString::fromLatin1("SizeHorCursor"); break;
+ case SizeBDiagCursor: type = QString::fromLatin1("SizeBDiagCursor"); break;
+ case SizeFDiagCursor: type = QString::fromLatin1("SizeFDiagCursor"); break;
+ case SizeAllCursor: type = QString::fromLatin1("SizeAllCursor"); break;
+ case BlankCursor: type = QString::fromLatin1("BlankCursor"); break;
+ case SplitVCursor: type = QString::fromLatin1("SplitVCursor"); break;
+ case SplitHCursor: type = QString::fromLatin1("SplitHCursor"); break;
+ case PointingHandCursor: type = QString::fromLatin1("PointingHandCursor"); break;
+ case ForbiddenCursor: type = QString::fromLatin1("ForbiddenCursor"); break;
+ case BitmapCursor: type = QString::fromLatin1("BitmapCursor"); break;
+#else
+ case Qt::ArrowCursor: type = QString::fromLatin1("ArrowCursor"); break;
+ case Qt::UpArrowCursor: type = QString::fromLatin1("UpArrowCursor"); break;
+ case Qt::CrossCursor: type = QString::fromLatin1("CrossCursor"); break;
+ case Qt::WaitCursor: type = QString::fromLatin1("WaitCursor"); break;
+ case Qt::IbeamCursor: type = QString::fromLatin1("IbeamCursor"); break;
+ case Qt::SizeVerCursor: type = QString::fromLatin1("SizeVerCursor"); break;
+ case Qt::SizeHorCursor: type = QString::fromLatin1("SizeHorCursor"); break;
+ case Qt::SizeBDiagCursor: type = QString::fromLatin1("SizeBDiagCursor"); break;
+ case Qt::SizeFDiagCursor: type = QString::fromLatin1("SizeFDiagCursor"); break;
+ case Qt::SizeAllCursor: type = QString::fromLatin1("SizeAllCursor"); break;
+ case Qt::BlankCursor: type = QString::fromLatin1("BlankCursor"); break;
+ case Qt::SplitVCursor: type = QString::fromLatin1("SplitVCursor"); break;
+ case Qt::SplitHCursor: type = QString::fromLatin1("SplitHCursor"); break;
+ case Qt::PointingHandCursor: type = QString::fromLatin1("PointingHandCursor"); break;
+ case Qt::ForbiddenCursor: type = QString::fromLatin1("ForbiddenCursor"); break;
+ case Qt::BitmapCursor: type = QString::fromLatin1("BitmapCursor"); break;
+#endif
+ }
+
+ _output += type;
+
+ return *this;
+}
+
+/*!
+ Writes a QDate value to the stream. The format is the one defined by
+ QDate::toString() and may be system-dependent.
+*/
+KDStream& KDStream::operator<<( const QDate& date )
+{
+ _output += date.toString();
+ return *this;
+}
+
+/*!
+ Writes a QDateTime value to the stream. The format is the one
+ defined by QDateTime::toString() and may be system-dependent.
+*/
+KDStream& KDStream::operator<<( const QDateTime& datetime )
+{
+ _output += datetime.toString();
+ return *this;
+}
+
+/*!
+ Writes a QTime value to the stream. The format is the one defined by
+ QTime::toString() and may be system-dependent.
+*/
+KDStream& KDStream::operator<<( const QTime& time )
+{
+ _output += time.toString();
+ return *this;
+}
+
+/*!
+ Writes a the raw name of a QFont value to the stream.
+*/
+KDStream& KDStream::operator<<( const QFont& font )
+{
+ _output += font.rawName();
+ return *this;
+}
+
+/*!
+ Writes a QPen value to the stream. The format is "QPen" plus the
+ width, the color, and the style as defined in the \a QPen reference
+ documentation.
+*/
+KDStream& KDStream::operator<<( const QPen& pen )
+{
+ QString style;
+ switch ( pen.style() ) {
+ case Qt::NoPen: style = QString::fromLatin1("NoPen"); break;
+ case Qt::SolidLine: style = QString::fromLatin1("SolidLine"); break;
+ case Qt::DashLine: style = QString::fromLatin1("DashLine"); break;
+ case Qt::DotLine: style = QString::fromLatin1("DotLine"); break;
+ case Qt::DashDotLine: style = QString::fromLatin1("DashDotLine"); break;
+ case Qt::DashDotDotLine : style = QString::fromLatin1("DashDotDotLine "); break;
+ case Qt::MPenStyle : break; // ignore
+ }
+
+ _output += QString::fromLatin1("QPen(%1,%2,%3)")
+ .arg( pen.width() )
+ .arg( QColor2Str( pen.color() ) )
+ .arg( style );
+ return *this;
+}
+
+/*!
+ Writes a QPoint value to the stream. The format is "(x,y)".
+*/
+KDStream& KDStream::operator<<( const QPoint& point )
+{
+ _output += QString::fromLatin1("(%1,%2)").arg(point.x()).arg(point.y() );
+ return *this;
+}
+
+/*!
+ Writes a QSize value to the stream. The format is "(w x h)".
+*/
+KDStream& KDStream::operator<<( const QSize& size )
+{
+ _output += QString::fromLatin1("%1x%2").arg(size.width()).arg(size.height());
+ return *this;
+}
+
+/*!
+ Writes a QRect value to the stream. The format is "(width x height
+ xoffset xpos yoffset ypos)".
+*/
+KDStream& KDStream::operator<<( const QRect& rect )
+{
+ QString xplus = (rect.x() >= 0) ? QString::fromLatin1("+") : QString::fromLatin1("");
+ QString yplus = (rect.y() >= 0) ? QString::fromLatin1("+") : QString::fromLatin1("");
+ _output += QString::fromLatin1("%1x%2%3%4%5%6")
+ .arg( rect.width() )
+ .arg( rect.height() )
+ .arg( xplus )
+ .arg( rect.x() )
+ .arg( yplus )
+ .arg( rect.y() );
+
+ return *this;
+}
+
+/*!
+ This is a helper method that converts a QColor object into a
+ string. For the predefined Qt colors, their name is output, for all
+ other colors, the output is in the form #RRGGBB (as defined by
+ QColor::name()).
+*/
+QString KDStream::QColor2Str( const QColor& col )
+{
+ if ( col == Qt::black )
+ return QString::fromLatin1("black");
+ else if ( col == Qt::white )
+ return QString::fromLatin1("white");
+ else if ( col == Qt::darkGray )
+ return QString::fromLatin1("darkGray");
+ else if ( col == Qt::gray )
+ return QString::fromLatin1("gray");
+ else if ( col == Qt::lightGray )
+ return QString::fromLatin1("lightGray");
+ else if ( col == Qt::red )
+ return QString::fromLatin1("red");
+ else if ( col == Qt::green )
+ return QString::fromLatin1("green");
+ else if ( col == Qt::blue )
+ return QString::fromLatin1("blue");
+ else if ( col == Qt::cyan )
+ return QString::fromLatin1("cyan");
+ else if ( col == Qt::magenta )
+ return QString::fromLatin1("magenta");
+ else if ( col == Qt::yellow )
+ return QString::fromLatin1("yellow");
+ else if ( col == Qt::darkRed )
+ return QString::fromLatin1("darkRed");
+ else if ( col == Qt::darkGreen )
+ return QString::fromLatin1("darkGreen");
+ else if ( col == Qt::darkBlue )
+ return QString::fromLatin1("darkBlue");
+ else if ( col == Qt::darkCyan )
+ return QString::fromLatin1("darkCyan");
+ else if ( col == Qt::darkMagenta )
+ return QString::fromLatin1("darkMagenta");
+ else if ( col == Qt::darkYellow )
+ return QString::fromLatin1("darkYellow");
+ else if ( col == Qt::color0 )
+ return QString::fromLatin1("color0");
+ else if ( col == Qt::color1 )
+ return QString::fromLatin1("color1");
+ else
+ return col.name();
+}
+
+/*!
+ Writes a QObject value to the stream. Included information is the
+ class name, the object name, the properties and their types.
+*/
+KDStream& KDStream::operator<<( const QObject& obj )
+{
+ *this << QString::fromLatin1(obj.className()) + QString::fromLatin1("(") + QString::fromLatin1(obj.name()) << QString::fromLatin1("):")<< endl;
+ QMetaObject* meta = obj.metaObject();
+ QStrList props = meta->propertyNames(true);
+
+ unsigned int maxWidth = 0;
+ for ( QStrListIterator it(props) ; *it; ++it ) {
+ maxWidth = QMAX( maxWidth, QString::fromLatin1(*it).length() );
+ }
+
+ for ( QStrListIterator it2(props) ; *it2; ++it2 ) {
+ *this << QString::fromLatin1(" ") << QString::fromLatin1(*it2).leftJustify(maxWidth) << QString::fromLatin1(": [") << obj.property(*it2) << QString::fromLatin1("]") << endl;
+ }
+ return *this;
+}
+
+/*!
+ Writes a QVariant value to the stream. The format is dependent on
+ the actual contents of the QVariant object.
+*/
+KDStream& KDStream::operator<<( const QVariant& var)
+{
+ switch (var.type() )
+ {
+ case QVariant::Invalid: *this << QString::fromLatin1("*INVALID*"); break;
+ case QVariant::Map: *this << var.toMap(); break;
+ case QVariant::List: *this << var.toList(); break;
+ case QVariant::String: *this << var.toString(); break;
+ case QVariant::StringList: *this << var.toStringList(); break;
+ case QVariant::Font: *this << var.toFont(); break;
+ case QVariant::Pixmap: *this << var.toPixmap();break;
+
+ case QVariant::Brush: *this << var.toBrush(); break;
+ case QVariant::Rect: *this << var.toRect(); break;
+ case QVariant::Size: *this << var.toSize(); break;
+ case QVariant::Color: *this << var.toColor(); break;
+ case QVariant::Palette: *this << var.toPalette(); break;
+ case QVariant::ColorGroup: *this << var.toColorGroup(); break;
+ case QVariant::IconSet: *this << QString::fromLatin1("-"); break;
+ case QVariant::Point: *this << var.toPoint(); break;
+ case QVariant::Image: *this << var.toImage(); break;
+ case QVariant::Int: *this << var.toInt(); break;
+ case QVariant::UInt: *this << var.toUInt(); break;
+ case QVariant::Bool: *this << var.toBool(); break;
+ case QVariant::Double: *this << var.toDouble(); break;
+ case QVariant::CString: *this << var.toCString(); break;
+ case QVariant::PointArray: *this << var.toPointArray(); break;
+ case QVariant::Region: *this << QString::fromLatin1("-"); break;
+ case QVariant::Bitmap: *this << QString::fromLatin1("-"); break;
+ case QVariant::Cursor: *this << var.toCursor(); break;
+ case QVariant::SizePolicy: *this << var.toSizePolicy(); break;
+#if ( QT_VERSION >= 300 )
+ case QVariant::Date: *this << var.toDate(); break;
+ case QVariant::Time: *this << var.toTime(); break;
+ case QVariant::DateTime: *this << var.toDateTime(); break;
+ case QVariant::ByteArray: *this << var.toByteArray(); break;
+ case QVariant::BitArray: *this << var.toBitArray(); break;
+ case QVariant::KeySequence: *this << var.toKeySequence(); break;
+#if ( QT_VERSION >= 0x030100 )
+ case QVariant::Pen: *this << var.toPen(); break;
+#endif
+#endif
+ }
+ return *this;
+}
+
+/*!
+ Writes a QBrush value to the stream. The format is "QBrush" plus the
+ brush style as listed in the \a QBrush reference documentation and
+ the brush color.
+*/
+KDStream& KDStream::operator<<( const QBrush& brush)
+{
+ QString style;
+ switch ( brush.style() )
+ {
+ case Qt::NoBrush: style = QString::fromLatin1("NoBrush"); break;
+ case Qt::SolidPattern: style = QString::fromLatin1("SolidPattern"); break;
+ case Qt::Dense1Pattern: style = QString::fromLatin1("Dense1Pattern"); break;
+ case Qt::Dense2Pattern: style = QString::fromLatin1("Dense2Pattern"); break;
+ case Qt::Dense3Pattern: style = QString::fromLatin1("Dense3Pattern"); break;
+ case Qt::Dense4Pattern: style = QString::fromLatin1("Dense4Pattern"); break;
+ case Qt::Dense5Pattern: style = QString::fromLatin1("Dense5Pattern"); break;
+ case Qt::Dense6Pattern: style = QString::fromLatin1("Dense6Pattern"); break;
+ case Qt::Dense7Pattern: style = QString::fromLatin1("Dense7Pattern"); break;
+ case Qt::HorPattern: style = QString::fromLatin1("HorPattern"); break;
+ case Qt::VerPattern: style = QString::fromLatin1("VerPattern"); break;
+ case Qt::CrossPattern: style = QString::fromLatin1("CrossPattern"); break;
+ case Qt::BDiagPattern: style = QString::fromLatin1("BDiagPattern"); break;
+ case Qt::FDiagPattern: style = QString::fromLatin1("FDiagPattern"); break;
+ case Qt::DiagCrossPattern: style = QString::fromLatin1("DiagCrossPattern"); break;
+ case Qt::CustomPattern: style = QString::fromLatin1("CustomPattern"); break;
+ }
+ _output += QString::fromLatin1("QBrush(%1,%2)").arg(style).arg(QColor2Str(brush.color()));
+ return *this;
+}
+
+/*!
+ Writes a QSizePolicy value to the stream. The output contains the
+ horizontal and vertical size policy and whether the policy has a
+ "height for width" setting.
+*/
+KDStream& KDStream::operator<<( const QSizePolicy& policy)
+{
+ QString hor, ver;
+
+ switch ( policy.horData() )
+ {
+ case QSizePolicy::Fixed: hor=QString::fromLatin1("Fixed"); break;
+ case QSizePolicy::Minimum : hor=QString::fromLatin1("Minimum "); break;
+ case QSizePolicy::Maximum: hor=QString::fromLatin1("Maximum"); break;
+ case QSizePolicy::Preferred: hor=QString::fromLatin1("Preferred"); break;
+ case QSizePolicy::MinimumExpanding: hor=QString::fromLatin1("MinimumExpanding"); break;
+ case QSizePolicy::Expanding: hor=QString::fromLatin1("Expanding"); break;
+#if ( QT_VERSION >= 300 )
+ case QSizePolicy::Ignored: hor=QString::fromLatin1("Ignored"); break;
+#endif
+ }
+ switch ( policy.verData() )
+ {
+ case QSizePolicy::Fixed: ver=QString::fromLatin1("Fixed"); break;
+ case QSizePolicy::Minimum : ver=QString::fromLatin1("Minimum "); break;
+ case QSizePolicy::Maximum: ver=QString::fromLatin1("Maximum"); break;
+ case QSizePolicy::Preferred: ver=QString::fromLatin1("Preferred"); break;
+ case QSizePolicy::MinimumExpanding: ver=QString::fromLatin1("MinimumExpanding"); break;
+ case QSizePolicy::Expanding: ver=QString::fromLatin1("Expanding"); break;
+#if ( QT_VERSION >= 300 )
+ case QSizePolicy::Ignored: ver=QString::fromLatin1("Ignored"); break;
+#endif
+ }
+ QString hforw = policy.hasHeightForWidth() ? QString::fromLatin1("true") : QString::fromLatin1("false");
+ _output += QString::fromLatin1("QSizePolicy(hor=%1,ver=%2, hasHeightForWidth=%3)")
+ .arg(hor).arg(ver).arg(hforw);
+ return *this;
+}
+
+#if ( QT_VERSION >= 300 )
+/*!
+ Writes a QKeySequence value to the stream. The output format is the
+ string value of the key sequence.
+*/
+KDStream& KDStream::operator<<( const QKeySequence& keySeq)
+{
+ _output += QString(keySeq);
+ return *this;
+}
+#endif
+
+/*!
+ Writes a QStrList value to the stream. The output is the individual
+ strings.
+*/
+KDStream& KDStream::operator<<( const QStrList& list )
+{
+ KDStream_ptrListStream( *this, QStrListIterator( list ), false );
+ return *this;
+}
+
+
+KDStream& KDStream::operator<<( const QPixmap& pixmap )
+{
+ _output += QString("QPixmap[null=%1,width=%2,heigth=%3,depth=%4,hasMask=%5,hasAlpha=%6]")
+ .arg(pixmap.isNull()).arg(pixmap.width()).arg(pixmap.height())
+ .arg(pixmap.depth()).arg(pixmap.mask() != 0).arg(pixmap.hasAlpha() );
+ return *this;
+}
+
+
+KDStream& KDStream::operator<<( const QImage& pixmap )
+{
+ _output += QString("QImage[null=%1,width=%2,heigth=%3,depth=%4,hasAlpha=%5]")
+ .arg(pixmap.isNull()).arg(pixmap.width()).arg(pixmap.height())
+ .arg(pixmap.depth()).arg(pixmap.hasAlphaBuffer() );
+ return *this;
+}
+
+/* Classes that do not need to be supported:
+
+QCollection - abstract class // Qt 2
+QBitArray - QArray implemented.
+QByteArray - QAray implemented.
+QPointArray - QAray implemented.
+QGArray - internal class // Qt 2
+QStringList - It's just a QValueList.
+
+QGCache // Qt 2
+QGDict // Qt 2
+QGList // Qt 2
+QGVector // Qt 2
+QGCacheIterator // Qt 2
+QAsciiCacheIterator
+QCacheIterator
+QIntCacheIterator
+QGDictIterator // Qt 2
+QAsciiDictIterator
+QDictIterator
+QIntDictIterator
+QPtrDictIterator
+QListIterator // Qt 2
+QStrListIterator
+QGListIterator // Qt 2
+QMapConstIterator
+QMapIterator
+QBitVal
+QValueListConstIterator
+QValueListIterator
+QPtrListIterator// Qt 3
+QPtrCollection// Qt 3
+QSortedList - Depricated // Qt 2
+
+*/
+
+/* Qt classes not yet supported:
+QRegion
+QAccel
+QAccessible // Qt 3
+QAccessibleInterface// Qt 3
+QAccessibleObject// Qt 3
+QAction
+QActionGroup
+QApplication
+QAsyncIO // Qt 2
+QBitmap
+QBoxLayout
+QBuffer
+QButton
+QButtonGroup
+QCDEStyle
+QCanvas
+QCanvasEllipse
+QCanvasItem
+QCanvasItemList// Qt 3
+QCanvasLine
+QCanvasPixmap
+QCanvasPixmapArray
+QCanvasPolygon
+QCanvasPolygonalItem
+QCanvasRectangle
+QCanvasSpline// Qt 3
+QCanvasSprite
+QCanvasText
+QCanvasView
+QCheckBox
+QCheckListItem
+QCheckTableItem// Qt 3
+QChildEvent
+QClipboard
+QCloseEvent
+QColorDialog
+QColorDrag
+QComboBox
+QComboTableItem// Qt 3
+QCommonStyle
+QComponentFactory// Qt 3
+QComponentFactoryInterface// Qt 3
+QComponentInterface// Qt 3
+QComponentServerInterface// Qt 3
+QContextMenuEvent// Qt 3
+QCopChannel
+QCustomEvent
+QCustomMenuItem
+QDataBrowser// Qt 3
+QDataPump // Qt 2
+QDataSink // Qt 2
+QDataSource // Qt 2
+QDataStream
+QDataTable// Qt 3
+QDataView// Qt 3
+QDateEdit// Qt 3
+QDateTimeEdit// Qt 3
+QDesktopWidget// Qt 3
+QDial
+QDialog
+QDir
+QDns
+QDockArea// Qt 3
+QDockWindow// Qt 3
+QDomAttr
+QDomCDATASection
+QDomCharacterData
+QDomComment
+QDomDocument
+QDomDocumentFragment
+QDomDocumentType
+QDomElement
+QDomEntity
+QDomEntityReference
+QDomImplementation
+QDomNamedNodeMap
+QDomNode
+QDomNodeList
+QDomNotation
+QDomProcessingInstruction
+QDomText
+QDoubleValidator
+QDragEnterEvent
+QDragLeaveEvent
+QDragMoveEvent
+QDragObject
+QDropEvent
+QDropSite // Qt 2
+QEditorFactory// Qt 3
+QErrorMessage// Qt 3
+QEucJpCodec // Qt 2
+QEucKrCodec // Qt 2
+QEvent
+QFeatureListInterface// Qt 3
+QFile
+QFileDialog
+QFileIconProvider
+QFileInfo
+QFilePreview
+QFocusData
+QFocusEvent
+QFontDatabase
+QFontDialog
+QFontInfo
+QFontManager// Qt 3
+QFontMetrics
+QFrame
+QFtp
+QGL
+QGLColormap// Qt 3
+QGLContext
+QGLFormat
+QGLWidget
+QGLayoutIterator
+QGbkCodec // Qt 2
+QGrid
+QGridLayout
+QGridView// Qt 3
+QGroupBox
+QGuardedPtr
+QHBox
+QHBoxLayout
+QHButtonGroup
+QHGroupBox
+QHeader
+QHideEvent
+QHostAddress
+QHttp// Qt 3
+QIMEvent// Qt 3
+QIODevice
+QIODeviceSource // Qt 2
+QIconDrag
+QIconDragItem
+QIconSet
+QIconView
+QIconViewItem
+QImageConsumer
+QImageDecoder
+QImageDrag
+QImageFormat
+QImageFormatType
+QImageIO
+QInputDialog
+QIntValidator
+QInterlaceStyle
+QJisCodec // Qt 2
+QJpUnicodeConv // Qt 2
+QKeyEvent
+QLCDNumber
+QLNode // Qt 2
+QLabel
+QLayout
+QLayoutItem
+QLayoutIterator
+QLibrary// Qt 3
+QLibraryInterface// Qt 3
+QLineEdit
+QListBox
+QListBoxItem
+QListBoxPixmap
+QListBoxText
+QListView
+QListViewItem
+QListViewItemIterator
+QLocalFs
+QLock// Qt 3
+QMainWindow
+QMap
+QMemArray// Qt 3
+QMenuBar
+QMenuData
+QMessageBox
+QMetaObject
+QMetaProperty
+QMimeSource
+QMimeSourceFactory
+QMotifPlusStyle
+QMotifStyle
+QMouseEvent
+QMoveEvent
+QMovie
+QMultiLineEdit // Qt 2
+QMutex
+QNPInstance
+QNPStream
+QNPWidget
+QNPlugin
+QNetworkOperation
+QNetworkProtocol
+QObject
+QPNGImagePacker
+QPaintDevice
+QPaintDeviceMetrics
+QPaintEvent
+QPainter
+QPicture
+QPixmapCache
+QPlatinumStyle
+QPluginManager// Qt 3
+QPopupMenu
+QPrinter
+QProcess// Qt 3
+QProgressBar
+QProgressDialog
+QPushButton
+QRadioButton
+QRangeControl
+QRegExp
+QRegExpValidator// Qt 3
+QResizeEvent
+QSGIStyle
+QScreen// Qt 3
+QScreenCursor // Qt 2
+QScrollBar
+QScrollView
+QSemaphore
+QSemiModal // Qt 2
+QServerSocket
+QSessionManager
+QSettings// Qt 3
+QShared // Qt 2
+QShowEvent
+QSignal
+QSignalMapper
+QSimpleRichText
+QSizeGrip
+QSjisCodec // Qt 2
+QSlider
+QSocket
+QSocketDevice
+QSocketNotifier
+QSound
+QSpacerItem
+QSpinBox
+QSplitter
+QSql// Qt 3
+QSqlCursor// Qt 3
+QSqlDatabase// Qt 3
+QSqlDriver// Qt 3
+QSqlEditorFactory// Qt 3
+QSqlError// Qt 3
+QSqlField// Qt 3
+QSqlForm// Qt 3
+QSqlIndex// Qt 3
+QSqlPropertyMap// Qt 3
+QSqlQuery// Qt 3
+QSqlRecord// Qt 3
+QSqlResult// Qt 3
+QStatusBar
+QStoredDrag
+QStyle
+QStyleSheet
+QStyleSheetItem
+QTab
+QTabBar
+QTabDialog
+QTabWidget
+QTable
+QTableItem
+QTableSelection
+QTableView // Qt 2
+QTabletEvent// Qt 3
+QTextBrowser
+QTextCodec
+QTextDecoder
+QTextDrag
+QTextEdit// Qt 3
+QTextEncoder
+QTextIStream
+QTextOStream
+QTextStream
+QTextView // Qt 2
+QThread
+QTimeEdit// Qt 3
+QTimer
+QTimerEvent
+QToolBar
+QToolButton
+QToolTip
+QToolTipGroup
+QTranslator
+QTranslatorMessage
+QTsciiCodec // Qt 2
+QUnknownInterface// Qt 3
+QUriDrag
+QUrl
+QUrlInfo// Qt 3
+QUrlOperator
+QUuid// Qt 3
+QVBox
+QVBoxLayout
+QVButtonGroup
+QVGroupBox
+QValidator
+QVariant
+QWMatrix
+QWSDecoration
+QWSKeyboardHandler
+QWSMouseHandler
+QWSServer
+QWSWindow
+QWaitCondition
+QWhatsThis
+QWheelEvent
+QWidget
+QWidgetFactory// Qt 3
+QWidgetItem
+QWidgetStack
+QWindowsMime// Qt 3
+QWindowsStyle
+QWizard
+QWorkspace
+QXmlAttributes
+QXmlContentHandler
+QXmlDTDHandler
+QXmlDeclHandler
+QXmlDefaultHandler
+QXmlEntityResolver
+QXmlErrorHandler
+QXmlInputSource
+QXmlLexicalHandler
+QXmlLocator
+QXmlNamespaceSupport
+QXmlParseException
+QXmlReader
+QXmlSimpleReader
+QXtApplication
+QXtWidget
+Qt
+*/
diff --git a/libkipi/libkipi/KDStream.h b/libkipi/libkipi/KDStream.h
new file mode 100644
index 0000000..9685645
--- /dev/null
+++ b/libkipi/libkipi/KDStream.h
@@ -0,0 +1,375 @@
+/* -*- Mode: C++ -*-
+ KD Tools - a set of useful widgets for Qt
+ $Id: KDStream.h 387954 2005-02-10 07:49:40Z blackie $
+*/
+
+/****************************************************************************
+** Copyright (C) 2001-2005 Klarlvdalens Datakonsult AB. All rights reserved.
+**
+** This file is part of the KD Tools library.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid commercial KD Tools licenses may use this file in
+** accordance with the KD Tools Commercial License Agreement provided with
+** the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** Contact info@klaralvdalens-datakonsult.se if any conditions of this
+** licensing are not clear to you.
+**
+**********************************************************************/
+
+#ifndef KIPI_KDSTREAM
+#define KIPI_KDSTREAM
+
+// Forward declarations.
+class QImage;
+class QPixmap;
+class QColor;
+class QColorGroup;
+class QPalette;
+class QCursor;
+class QDate;
+class QDateTime;
+class QTime;
+class QFont;
+class QPen;
+class QPoint;
+class QSize;
+class QRect;
+class QObject;
+class QVariant;
+class QBrush;
+class QSizePolicy;
+class QKeySequence;
+
+#include <qstring.h>
+#include <qvaluelist.h>
+#include <qstrlist.h>
+#include <qasciidict.h>
+#include <qintdict.h>
+#include <qptrdict.h>
+#include <qdict.h>
+#include <qvaluestack.h>
+#include <qasciicache.h>
+#include <qintcache.h>
+#include <qcache.h>
+
+#if ( QT_VERSION < 300 )
+#include <qlist.h>
+#include <qstack.h>
+#include <qqueue.h>
+#include <qvector.h>
+#endif
+
+#if ( QT_VERSION >= 300 )
+#include <qptrlist.h>
+#include <qptrstack.h>
+#include <qptrqueue.h>
+#include <qpair.h>
+#include <qptrvector.h>
+#include <qvaluevector.h>
+#endif
+
+// utility functions.
+class KDStream;
+typedef KDStream & (*KDSTREAMFUNC)(KDStream &);
+KDStream& endl( KDStream& stream);
+KDStream& flush( KDStream& stream);
+
+class KDStream
+{
+public:
+ KDStream( QString* outputString = 0);
+ ~KDStream();
+ void flush();
+
+ // Standard C++ types
+ KDStream& operator<<( bool );
+ KDStream& operator<<( char );
+ KDStream& operator<<( float );
+ KDStream& operator<<( double );
+ KDStream& operator<<( short );
+ KDStream& operator<<( unsigned short );
+ KDStream& operator<<( int );
+ KDStream& operator<<( unsigned int );
+ KDStream& operator<<( long );
+ KDStream& operator<<( unsigned long );
+ KDStream& operator<<( const char* );
+ KDStream& operator<<( const void* );
+
+ // Data holding classes.
+ KDStream& operator<<( const QString& );
+ KDStream& operator<<( const QCString& );
+ KDStream& operator<<( const QChar& );
+
+ KDStream& operator<<( const QColor& );
+ KDStream& operator<<( const QColorGroup& );
+ KDStream& operator<<( const QPalette& );
+ KDStream& operator<<( const QCursor& );
+
+ KDStream& operator<<( const QDate& );
+ KDStream& operator<<( const QDateTime& );
+ KDStream& operator<<( const QTime& );
+
+ KDStream& operator<<( const QFont& );
+ KDStream& operator<<( const QPen& );
+ KDStream& operator<<( const QPoint& );
+ KDStream& operator<<( const QSize& );
+ KDStream& operator<<( const QRect& );
+ KDStream& operator<<( const QBrush& );
+ KDStream& operator<<( const QSizePolicy& );
+ KDStream& operator<<( const QKeySequence& );
+ KDStream& operator<<( const QPixmap& );
+ KDStream& operator<<( const QImage& );
+
+ // misc
+ KDStream& operator<<( KDSTREAMFUNC );
+ KDStream& operator<<( const QVariant& );
+ KDStream& operator<<( const QObject& );
+ KDStream& operator<<( const QStrList& list );
+
+protected:
+ QString QColor2Str( const QColor& col );
+
+private:
+ QString _output;
+ QString* _out;
+};
+
+
+// Helper functions for KDStream.
+// Defined as global functions to support
+// compilers without support for member templates
+// You should not need to call those yourself
+template <class Iterator> void KDStream_valueListStream( KDStream& st, Iterator begin, Iterator end )
+{
+ st << "[";
+ bool first = true;
+ for ( Iterator it = begin; it != end; ++it ){
+ if ( first )
+ first = false;
+ else
+ st << ", ";
+ st << *it;
+ }
+ st << "]";
+}
+
+template<class Iterator> void KDStream_ptrListStream( KDStream& st, Iterator it, bool doubleDeref )
+{
+ st << "[";
+ bool first = true;
+ for ( ; *it; ++ it) {
+ if ( first )
+ first = false;
+ else
+ st << ", ";
+
+ if ( doubleDeref )
+ st << *(*it);
+ else {
+ // QStrList ought to be a value list rather than a ptr list, one less dereference is
+ // necesary here, otherwise we will only stream out a char, rather than a char *
+ st << *it;
+ }
+ }
+ st << "]";
+}
+
+template<class Iterator> void KDStream_ptrDictStream( KDStream& st, Iterator it )
+{
+ st << "{";
+ bool first = true;
+ for ( ; it; ++ it) {
+ if ( first )
+ first = false;
+ else
+ st << ", ";
+
+ st << (it.currentKey()) << ": " << *(it.current()) ;
+ }
+ st << "}";
+}
+
+// Stream operators for containers
+// Defined as global functions to support
+// compilers without member templates
+
+template<class T> KDStream& operator<<( KDStream& st, const QValueList<T>& list )
+{
+ KDStream_valueListStream( st, list.begin(), list.end() );
+ return st;
+}
+
+#if ( QT_VERSION < 300 )
+template<class T> KDStream& operator<<( KDStream& st, const QList<T>& list )
+{
+ KDStream_ptrListStream ( st, QListIterator<T>( list ) , true );
+ return st;
+}
+
+template<class T> KDStream& operator<<( KDStream& st, const QArray<T>& array )
+{
+ KDStream_valueListStream( st, array.begin(), array.end() );
+ return st;
+}
+
+template<class T> KDStream& operator<<( KDStream& st, const QVector<T>& vector )
+{
+ QList<T> list;
+ vector.toList( &list );
+
+ KDStream_ptrListStream ( st, QListIterator<T>( list ), true );
+ return st;
+}
+#endif
+#if ( QT_VERSION >= 300 )
+template<class T> KDStream& operator<<( KDStream& st, const QMemArray<T>& array )
+{
+ KDStream_valueListStream( st, array.begin(), array.end() );
+ return st;
+}
+
+template<class T> KDStream& operator<<( KDStream& st, const QPtrList<T>& list )
+{
+ KDStream_ptrListStream ( st, QPtrListIterator<T>( list ), true );
+ return st;
+}
+
+template<class T1, class T2> KDStream& operator<<( KDStream& st, const QPair<T1,T2>& pair )
+{
+ st << "(" << pair.first << "," << pair.second << ")";
+ return st;
+}
+
+template<class T> KDStream& operator<<( KDStream& st, const QPtrVector<T>& vector )
+{
+ QPtrList<T> list;
+ vector.toList( &list );
+
+ KDStream_ptrListStream( st, QPtrListIterator<T>( list ), true );
+ return st;
+}
+
+template<class T> KDStream& operator<<( KDStream& st, const QValueVector<T>& vector )
+{
+ KDStream_valueListStream( st, vector.begin(), vector.end() );
+ return st;
+}
+#endif
+
+#if ( QT_VERSION < 300 )
+template<class T> KDStream& operator<<( KDStream& st, const QStack<T>& stack )
+{
+ // I need a copy to look at the individual elements.
+ QStack<T> copy(stack);
+#else
+template<class T> KDStream& operator<<( KDStream& st, const QPtrStack<T>& stack )
+{
+
+ // I need a copy to look at the individual elements.
+ QPtrStack<T> copy(stack);
+ /*}*/
+#endif
+ st << "[";
+ if ( stack.count() > 1 )
+ st << "top| ";
+ st << " ";
+
+ bool first = true;
+ while ( !copy.isEmpty() ) {
+ if (first)
+ first = false;
+ else
+ st << ", ";
+ st << *(copy.pop());
+ }
+
+ st << " ";
+ if ( stack.count() > 1 )
+ st << " |bottom";
+ st << "]";
+ return st;
+}
+
+// This function can unfortunately not be merged with the function for
+// Q(Ptr)Stack, as the Q(Ptr)Stack dereferences what it pops of the stack,
+// before streaming it:
+// Q(Ptr)Stack: *this << *(copy.pop());
+// QValueStack: *this << copy.pop() ;
+template<class T> KDStream& operator<<( KDStream& st, const QValueStack<T>& stack )
+{
+ // I need a copy to look at the individual elements.
+ QValueStack<T> copy(stack);
+ st << "[";
+ if ( stack.count() > 1 )
+ st << "top| ";
+ st << " ";
+
+ bool first = true;
+ while ( !copy.isEmpty() ) {
+ if (first)
+ first = false;
+ else
+ st << ", ";
+ st << copy.pop();
+ }
+
+ st << " ";
+ if ( stack.count() > 1 )
+ st << " |bottom";
+ st << "]";
+ return st;
+}
+
+
+template<class T> KDStream& operator<<( KDStream& st, const QAsciiDict<T>& dict )
+{
+ KDStream_ptrDictStream( st, QAsciiDictIterator<T>( dict ) );
+ return st;
+}
+
+template<class T> KDStream& operator<<( KDStream& st, const QIntDict<T>& dict )
+{
+ KDStream_ptrDictStream( st, QIntDictIterator<T>( dict ) );
+ return st;
+}
+
+template<class T> KDStream& operator<<( KDStream& st, const QPtrDict<T>& dict )
+{
+ KDStream_ptrDictStream( st, QPtrDictIterator<T>( dict ) );
+ return st;
+}
+
+template<class T> KDStream& operator<<( KDStream& st, const QDict<T>& dict )
+{
+ KDStream_ptrDictStream( st, QDictIterator<T>( dict ) );
+ return st;
+}
+
+template<class T> KDStream& operator<<( KDStream& st, const QAsciiCache<T>& cache )
+{
+ KDStream_ptrDictStream( st, QAsciiCacheIterator<T>( cache ) );
+ return st;
+}
+
+template<class T> KDStream& operator<<( KDStream& st, const QIntCache<T>& cache )
+{
+ KDStream_ptrDictStream( st, QIntCacheIterator<T>( cache ) );
+ return st;
+}
+
+template<class T> KDStream& operator<<( KDStream& st, const QCache<T>& cache )
+{
+ KDStream_ptrDictStream( st, QCacheIterator<T>( cache ) );
+ return st;
+}
+
+#endif /* KDStream */
diff --git a/libkipi/libkipi/KDTools-License-US b/libkipi/libkipi/KDTools-License-US
new file mode 100644
index 0000000..887af55
--- /dev/null
+++ b/libkipi/libkipi/KDTools-License-US
@@ -0,0 +1,138 @@
+KD Tools COMMERCIAL LICENSE AGREEMENT
+FOR COMMERCIAL VERSIONS
+March 27, 2002
+
+
+IMPORTANT-READ CAREFULLY: This Klarlvdalens Datakonsult AB End-User
+License Agreement ("EULA") is a legal agreement between you (either an
+individual or a legal entity) and Klarlvdalens Datakonsult AB
+("KDAB") for the Klarlvdalens Datakonsult AB software product(s)
+accompanying this EULA, which include(s) computer software and may
+include "online" or electronic documentation, associated media, and
+printed materials ("Licensed Product").
+
+The Licensed Product is protected by copyright laws and international
+copyright treaties, as well as other intellectual property laws and
+treaties. The Licensed Product is licensed, not sold.
+
+By installing, copying, or otherwise using the Licensed Product, you
+agree to be bound by the terms of this EULA. If you do not agree to
+the terms of this EULA, do not install, copy, or otherwise use the
+Licensed Product; you may, however, return it to your place of
+purchase for a full refund. In addition, by installing, copying, or
+otherwise using any updates or other components of the Licensed
+Product that you receive separately as part of the Licensed Product
+("Updates"), you agree to be bound by any additional license terms
+that accompany such Updates. If you do not agree to the additional
+license terms that accompany such Updates, you may not install, copy,
+or otherwise use such Updates.
+
+Upon your acceptance of the terms and conditions of this EULA, KDAB
+grants you the right to use the Licensed Product in the manner
+provided below.
+
+KDAB grants to you as an individual a personal, nonexclusive,
+nontransferable license to make and use copies of the Licensed Product
+for the sole purposes of designing, developing, and testing your
+software product(s) ("Applications"). You may install copies of the
+Licensed Product on an unlimited number of computers provided that you
+are the only individual using the Licensed Product. If you are an
+entity, KDAB grants you the right to designate one, and only one,
+individual within your organization who shall have the sole right to
+use the Licensed Product in the manner provided above. You may at any
+time, but not more frequently that once every six (6) months,
+designate another individual to replace the current designated user by
+notifying KDAB, so long as there is no more than one designated user
+at any given time.
+
+
+GENERAL TERMS THAT APPLY TO APPLICATIONS AND REDISTRIBUTABLES
+KDAB grants you a nonexclusive, royalty-free right to reproduce and
+distribute the object code form of any portion of the Licensed Product
+("Redistributables") for execution on any operating system of a type
+listed in the License Certificate ("Platforms"). Copies of
+Redistributables may only be distributed with and for the sole purpose
+of executing Applications permitted under this License Agreement that
+you have created using the Licensed Product. Under no circumstances
+may any copies of Redistributables be distributed separately.
+
+The license granted in this EULA for you to create your own
+Applications and distribute them and the Redistributables (if any) to
+your customers is subject to all of the following conditions: (i) all
+copies of the Applications you create must bear a valid copyright
+notice, either your own or the copyright notice that appears on the
+Licensed Product; (ii) you may not remove or alter any copyright,
+trademark or other proprietary rights notice contained in any portion
+of the Licensed Product; (iii) Redistributables, if any, shall be
+licensed to your customer "as is" (KDAB MAKES NO WARRANTIES OR
+REPRESENTATIONS VIS-A-VIS YOUR CUSTOMER WITH RESPECT TO
+REDISTRIBUTABLES, AND KDAB EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES
+VIS-A-VIS YOUR CUSTOMER, WHETHER EXPRESS OR IMPLIED, ORAL OR WRITTEN,
+INCLUDING, BUT NOT LIMITED TO ANY IMPLIED WARRANTY OF MERCHANTABILITY
+OR FITNESS FOR ANY PARTICULAR PURPOSE, WHETHER OR NOT KDAB KNOWS, HAS
+REASON TO KNOW, HAS BEEN ADVISED OR IS OTHERWISE AWARE OF SUCH
+PURPOSE); (iv) you will indemnify and hold KDAB, its related companies
+and its suppliers, harmless from and against any claims or liabilities
+arising out of the use, reproduction or distribution of your
+Applications; (v) your Applications must be written using a licensed,
+registered copy of the Licensed Product; (vi) your Applications must
+add primary and substantial functionality to the Licensed Product;
+(vii) your Applications may not pass on functionality which in any way
+makes it possible for others to create Applications with the Software;
+(viii) your Applications may not compete with the Licensed Product;
+(ix)) you may not use KDAB's or any of its suppliers' names, logos, or
+trademarks to market your programs, except to state that your program
+was written using the Licensed Product.
+
+
+WARRANTY DISCLAIMER
+THE LICENSED PRODUCT IS LICENSED TO YOU "AS IS". TO THE MAXIMUM
+EXTENT PERMITTED BY APPLICABLE LAW, KDAB ON BEHALF OF ITSELF AND ITS
+SUPPLIERS, DISCLAIMS ALL WARRANTIES AND CONDITIONS, EITHER EXPRESS OR
+IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
+NON-INFRINGEMENT WITH REGARD TO THE LICENSED PRODUCT. THIS WARRANTY
+DISCLAIMER NOTWITHSTANDING, YOU MAY HAVE SPECIFIC LEGAL RIGHTS WHICH
+MAY VARY FROM STATE/JURISDICTION TO STATE/JURISDICTION.
+
+
+LIMITATION OF LIABILITY
+IF, KDAB'S WARRANTY DISCLAIMER NOTWITHSTANDING, KDAB IS HELD LIABLE TO
+YOU, WHETHER IN CONTRACT, TORT OR ANY OTHER LEGAL THEORY, BASED ON THE
+LICENSED PRODUCT, KDAB'S ENTIRE LIABILITY TO YOU AND YOUR EXCLUSIVE
+REMEDY SHALL BE, AT KDAB'S OPTION, EITHER (A) RETURN OF THE PRICE YOU
+PAID FOR THE LICENSED PRODUCT, OR (B) REPAIR OR REPLACEMENT OF THE
+LICENSED PRODUCT, PROVIDED YOU RETURN TO KDAB ALL COPIES OF THE
+LICENSED PRODUCT AS ORIGINALLY DELIVERED TO YOU. KDAB SHALL NOT UNDER
+ANY CIRCUMSTANCES BE LIABLE TO YOU BASED ON FAILURE OF THE LICENSED
+PRODUCT IF THE FAILURE RESULTED FROM ACCIDENT, ABUSE OR
+MISAPPLICATION, NOR SHALL KDAB UNDER ANY CIRCUMSTANCES BE LIABLE FOR
+SPECIAL DAMAGES, PUNITIVE OR EXEMPLARY DAMAGES, DAMAGES FOR LOSS OF
+PROFITS OR INTERRUPTION OF BUSINESS OR FOR LOSS OR CORRUPTION OF DATA.
+ANY AWARD OF DAMAGES FROM KDAB TO YOU SHALL NOT EXCEED THE TOTAL AMOUNT
+YOU HAVE PAID TO KDAB IN CONNECTION WITH THIS EULA.
+
+
+SUPPORT AND UPDATES
+You will receive email based, software developer support and access to
+Updates to the Licensed Product for one year from the date of initial
+delivery, in accordance with KDAB support policies and procedures.
+Such policies and procedures may be changed from time to time.
+
+
+GENERAL PROVISIONS
+This EULA may only be modified in writing signed by you and an
+authorized officer of KDAB. All terms of any purchase order or other
+ordering document shall be superseded by this EULA. If any provision
+of the EULA is found void or unenforceable, the remainder will remain
+valid and enforceable according to its terms. If any remedy provided
+is determined to have failed for its essential purpose, all
+limitations of liability and exclusions of damages set forth in this
+EULA shall remain in effect.
+
+This EULA shall be construed, interpreted and governed by the laws of
+Sweden, the venue to be Sunne Tingsrtt. The EULA gives you specific
+legal rights; you may have others, which vary from state to state and
+from country to country. KDAB reserves all rights not specifically
+granted in this EULA.
+
diff --git a/libkipi/libkipi/KDTools-License-non-US b/libkipi/libkipi/KDTools-License-non-US
new file mode 100644
index 0000000..fce2ae4
--- /dev/null
+++ b/libkipi/libkipi/KDTools-License-non-US
@@ -0,0 +1,93 @@
+KD Tools COMMERCIAL LICENSE AGREEMENT
+FOR COMMERCIAL VERSIONS
+Version 1.0
+
+Copyright of this license text (C) 2001 Trolltech AS and (C) 2002
+Klarlvdalens Datakonsult AB. All rights reserved. License text used
+with kind permission of Trolltech AS. The software and accompanying
+material is Copyright (C) 2002 Klarlvdalens Datakonsult AB.
+
+This non-exclusive non-transferable License Agreement ("Agreement") is
+between you ("Licensee") and Klarlvdalens Datakonsult AB (KDAB), and
+pertains to the Klarlvdalens Datakonsult AB software product(s)
+accompanying this Agreement, which include(s) computer software and
+may include "online" or electronic documentation, associated media,
+and printed materials, including the source code, example programs and
+the documentation ("Software").
+
+
+ COPYRIGHT AND RESTRICTIONS
+
+1. All intellectual property rights in the Software are owned by KDAB
+and are protected by Swedish copyright laws, other applicable
+copyright laws, and international treaty provisions. KDAB retains all
+rights not expressly granted. No title, property rights or copyright
+in the Software or in any modifications to the Software shall pass to
+the Licensee under any circumstances. The Software is licensed, not
+sold.
+
+2. By installing, copying, or otherwise using the Software, you agree
+to be bound by the terms of this agreement. If you do not agree to the
+terms of this Agreement, do not install, copy, or otherwise use the
+Software.
+
+3. Upon your acceptance of the terms and conditions of this Agreement,
+KDAB grants you the right to use the Software in the manner provided
+below.
+
+4. KDAB grants to you as an individual a personal, nonexclusive,
+non-transferable license to make and use copies of the Software for
+the sole purposes of designing, developing, testing and distributing
+your software product(s) ("Applications"). You may install copies of
+the Software on an unlimited number of computers provided that you are
+the only individual using the Software. If you are an entity, KDAB
+grants you the right to designate one, and only one, individual within
+your organization who shall have the sole right to use the Software in
+the manner provided above.
+
+5. The license granted in this Agreement for you to create and
+distribute your own Applications is subject to all of the following
+conditions: (i) all copies of the Applications you create must bear a
+valid copyright notice, either your own or the copyright notice that
+appears on the Software; (ii) you may not remove or alter any
+copyright, trademark or other proprietary rights notice contained in
+any portion of the Software; (iii) you will indemnify and hold KDAB, its
+related companies and its suppliers, harmless from and against any
+claims or liabilities arising out of the use and/or reproduction of
+your Applications; (iv) your Applications must be written using a
+licensed, registered copy of the Software; (v) your Applications must
+add primary and substantial functionality to the Software; (vi) your
+Applications may not pass on functionality which in any way makes it
+possible for others to create Applications with the Software; (vii)
+your Applications may not compete with the Software; (viii) you may
+not use KDAB's or any of its suppliers' names, logos, or trademarks to
+market your programs, except to state that your program was written
+using the Software.
+
+6. WARRANTY DISCLAIMER
+THE SOFTWARE IS LICENSED TO YOU "AS IS". TO THE MAXIMUM EXTENT
+PERMITTED BY APPLICABLE LAW, KDAB ON BEHALF OF ITSELF AND ITS SUPPLIERS,
+DISCLAIMS ALL WARRANTIES AND CONDITIONS, EITHER EXPRESS OR IMPLIED,
+INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT WITH
+REGARD TO THE SOFTWARE.
+
+7. LIMITATION OF LIABILITY
+IF, KDAB'S WARRANTY DISCLAIMER NOTWITHSTANDING, KDAB IS HELD LIABLE TO
+YOU BASED ON THE SOFTWARE, KDAB'S ENTIRE LIABILITY TO YOU AND YOUR
+EXCLUSIVE REMEDY SHALL BE, AT REPAIR OR REPLACEMENT OF THE SOFTWARE,
+PROVIDED YOU RETURN TO KDAB ALL COPIES OF THE SOFTWARE AS ORIGINALLY
+DELIVERED TO YOU. KDAB SHALL NOT UNDER ANY CIRCUMSTANCES BE LIABLE TO
+YOU BASED ON FAILURE OF THE SOFTWARE IF THE FAILURE RESULTED FROM
+ACCIDENT, ABUSE OR MISAPPLICATION, NOR SHALL KDAB UNDER ANY
+CIRCUMSTANCES BE LIABLE FOR SPECIAL DAMAGES, PUNITIVE OR EXEMPLARY
+DAMAGES, DAMAGES FOR LOSS OF PROFITS OR INTERRUPTION OF BUSINESS OR
+FOR LOSS OR CORRUPTION OF DATA.
+
+9. This Agreement may only be modified in writing signed by you and an
+authorized officer of KDAB. All terms of any purchase order or other
+ordering document shall be superseded by this Agreement.
+
+10. This Agreement shall be construed, interpreted and governed by the
+laws of Sweden, the venue to be Sunne Tingsrtt.
+
diff --git a/libkipi/libkipi/LICENSE.GPL b/libkipi/libkipi/LICENSE.GPL
new file mode 100644
index 0000000..f5bad8b
--- /dev/null
+++ b/libkipi/libkipi/LICENSE.GPL
@@ -0,0 +1,349 @@
+
+ The Qt GUI Toolkit is Copyright (C) 1994-2004 Trolltech AS.
+
+ You may use, distribute and copy the Qt GUI Toolkit under the terms of
+ GNU General Public License version 2, which is displayed below.
+
+-------------------------------------------------------------------------
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
+
+-------------------------------------------------------------------------
diff --git a/libkipi/libkipi/Makefile.am b/libkipi/libkipi/Makefile.am
new file mode 100644
index 0000000..8fb5206
--- /dev/null
+++ b/libkipi/libkipi/Makefile.am
@@ -0,0 +1,33 @@
+METASOURCES = AUTO
+INCLUDES = -I.. -I$(srcdir)/.. $(LIBKIPI_CFLAGS) $(all_includes)
+
+KDE_ICON = kipi
+
+lib_LTLIBRARIES = libkipi.la
+
+libkipi_la_SOURCES = interface.cpp plugin.cpp pluginloader.cpp KDStream.cpp imageinfo.cpp imagecollection.cpp \
+ imageinfoshared.cpp imagecollectionshared.cpp imagedialog.cpp uploadwidget.cpp \
+ batchprogressdialog.cpp imagecollectionselector.cpp
+
+noinst_HEADERS = KDStream.h
+
+libkipiinclude_HEADERS = interface.h plugin.h pluginloader.h imageinfo.h imagecollection.h imageinfoshared.h \
+ imagecollectionshared.h imagedialog.h uploadwidget.h batchprogressdialog.h \
+ imagecollectionselector.h version.h libkipi_export.h
+
+libkipi_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) \
+ -version-info 1:1:1 -no-undefined
+
+libkipi_la_LIBADD = $(LIB_KIO) $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_QT)
+
+libkipiincludedir = $(includedir)/libkipi
+
+kde_servicetypes_DATA = kipiplugin.desktop
+
+
+picsdir = $(kde_datadir)/kipi/data
+pics_DATA = kipi-plugins_logo.png banner_left.png
+
+EXTRA_DIST = $(pics_DATA)
+
+
diff --git a/libkipi/libkipi/banner_left.png b/libkipi/libkipi/banner_left.png
new file mode 100644
index 0000000..40a42f0
--- /dev/null
+++ b/libkipi/libkipi/banner_left.png
Binary files differ
diff --git a/libkipi/libkipi/batchprogressdialog.cpp b/libkipi/libkipi/batchprogressdialog.cpp
new file mode 100644
index 0000000..f516059
--- /dev/null
+++ b/libkipi/libkipi/batchprogressdialog.cpp
@@ -0,0 +1,224 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// BATCHPROGRESSDIALOG.CPP
+//
+// Copyright (C) 2004 Gilles Caulier <caulier dot gilles at free.fr>
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+
+// Include files for Qt
+
+#include <qvbox.h>
+#include <qlayout.h>
+#include <qdir.h>
+#include <qwidget.h>
+#include <qgroupbox.h>
+#include <qwhatsthis.h>
+#include <qcolor.h>
+#include <qhgroupbox.h>
+#include <qvgroupbox.h>
+#include <qheader.h>
+#include <qlistview.h>
+#include <qframe.h>
+#include <qlabel.h>
+#include <qcolor.h>
+#include <qpixmap.h>
+#include <qpushbutton.h>
+
+// Include files for KDE
+
+#include <klocale.h>
+#include <kprogress.h>
+#include <kinstance.h>
+#include <kconfig.h>
+#include <kapplication.h>
+#include <kdebug.h>
+#include <kdialogbase.h>
+#include <kiconloader.h>
+#include <klistview.h>
+#include <kstandarddirs.h>
+#include <kapplication.h>
+#include <kaboutdata.h>
+#include <khelpmenu.h>
+#include <kiconloader.h>
+#include <kpopupmenu.h>
+
+// Include files for libKipi.
+
+#include "libkipi/version.h"
+
+// Local includes
+
+#include "batchprogressdialog.h"
+
+namespace KIPI
+{
+
+class BatchProgressItem : public KListViewItem
+{
+public:
+ BatchProgressItem(KListView * parent, QListViewItem *after, const QString &message, int messageType)
+ : KListViewItem( parent, after), m_messagetype(messageType)
+ {
+ // Set the icon.
+
+ switch( m_messagetype )
+ {
+ case KIPI::StartingMessage:
+ setPixmap( 0, SmallIcon( "run" ) );
+ break;
+ case KIPI::SuccessMessage:
+ setPixmap( 0, SmallIcon( "ok" ) );
+ break;
+ case KIPI::WarningMessage:
+ setPixmap( 0, SmallIcon( "flag" ) );
+ break;
+ case KIPI::ErrorMessage:
+ setPixmap( 0, SmallIcon( "stop" ) );
+ break;
+ case KIPI::ProgressMessage:
+ setPixmap( 0, SmallIcon( "info" ) );
+ break;
+ default:
+ setPixmap( 0, SmallIcon( "info" ) );
+ }
+
+ // Set the message text.
+
+ setText(1, message);
+ }
+
+private:
+ int m_messagetype;
+
+ void paintCell (QPainter *p, const QColorGroup &cg, int column, int width, int alignment)
+ {
+ QColorGroup _cg( cg );
+
+ if ( m_messagetype == KIPI::ErrorMessage )
+ {
+ _cg.setColor( QColorGroup::Text, Qt::red );
+ KListViewItem::paintCell( p, _cg, column, width, alignment );
+ return;
+ }
+
+ if ( m_messagetype == KIPI::WarningMessage )
+ {
+ _cg.setColor( QColorGroup::Text, Qt::darkYellow );
+ KListViewItem::paintCell( p, _cg, column, width, alignment );
+ return;
+ }
+
+ KListViewItem::paintCell( p, cg, column, width, alignment );
+ }
+};
+
+
+struct BatchProgressDialog::Private {
+};
+
+
+/////////////////////////////////// CONSTRUCTOR ////////////////////////////////////////////
+
+BatchProgressDialog::BatchProgressDialog( QWidget *parent, const QString &caption )
+ : KDialogBase( parent, "KIPIBatchProgressDialog", true /* modal */,
+ caption, Cancel)
+{
+ d = new Private;
+ QWidget* box = makeVBoxMainWidget();
+
+ //---------------------------------------------
+
+ QFrame *headerFrame = new QFrame( box );
+ headerFrame->setFrameStyle(QFrame::Panel|QFrame::Sunken);
+ QHBoxLayout* layout = new QHBoxLayout( headerFrame );
+ layout->setMargin( 2 ); // to make sure the frame gets displayed
+ layout->setSpacing( 0 );
+ QLabel *pixmapLabelLeft = new QLabel( headerFrame, "pixmapLabelLeft" );
+ pixmapLabelLeft->setScaledContents( false );
+ layout->addWidget( pixmapLabelLeft );
+ QLabel *labelTitle = new QLabel( caption, headerFrame, "labelTitle" );
+ layout->addWidget( labelTitle );
+ layout->setStretchFactor( labelTitle, 1 );
+
+ QString dir;
+ KGlobal::dirs()->addResourceType("kipi_banner_left", KGlobal::dirs()->kde_default("data") + "kipi/data");
+ dir = KGlobal::dirs()->findResourceDir("kipi_banner_left", "banner_left.png");
+
+ pixmapLabelLeft->setPaletteBackgroundColor( QColor(201, 208, 255) );
+ pixmapLabelLeft->setPixmap( QPixmap( dir + "banner_left.png" ) );
+ labelTitle->setPaletteBackgroundColor( QColor(201, 208, 255) );
+
+ //---------------------------------------------
+
+
+ m_actionsList = new KListView( box );
+ m_actionsList->addColumn(i18n( "Status" ));
+ m_actionsList->addColumn(i18n( "Current Actions" ));
+ m_actionsList->setSorting(-1);
+ m_actionsList->setItemMargin(1);
+ m_actionsList->header()->hide();
+ m_actionsList->setResizeMode(QListView::LastColumn);
+ QWhatsThis::add( m_actionsList, i18n("<p>This is the current tasks list released.") );
+
+ //---------------------------------------------
+
+ m_progress = new KProgress( box, "Progress" );
+ m_progress->setTotalSteps(100);
+ m_progress->setValue(0);
+ QWhatsThis::add( m_progress, i18n("<p>This is the list current percent task released.") );
+ resize( 600, 400 );
+}
+
+
+//////////////////////////////////// DESTRUCTOR /////////////////////////////////////////////
+
+BatchProgressDialog::~BatchProgressDialog()
+{
+ delete d;
+}
+
+
+///////////////////////////////////// FONCTIONS /////////////////////////////////////////////
+
+void BatchProgressDialog::addedAction(const QString &text, int type)
+{
+ m_item = new KIPI::BatchProgressItem(m_actionsList,
+ m_actionsList->lastItem(),
+ text, type);
+
+ m_actionsList->ensureItemVisible(m_item);
+}
+
+
+void BatchProgressDialog::reset()
+{
+ m_actionsList->clear();
+ m_progress->setValue(0);
+}
+
+
+void BatchProgressDialog::setProgress(int current, int total)
+{
+ m_progress->setTotalSteps(total);
+ m_progress->setValue(current);
+}
+
+} // NameSpace KIPI
+
+#include "batchprogressdialog.moc"
diff --git a/libkipi/libkipi/batchprogressdialog.h b/libkipi/libkipi/batchprogressdialog.h
new file mode 100644
index 0000000..6ec06fb
--- /dev/null
+++ b/libkipi/libkipi/batchprogressdialog.h
@@ -0,0 +1,80 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// BATCHPROGRESSDIALOG.H
+//
+// Copyright (C) 2004 Gilles Caulier <caulier dot gilles at free.fr>
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+/** @file batchprogressdialog.h */
+
+#ifndef BATCHPROGRESSDIALOG_H
+#define BATCHPROGRESSDIALOG_H
+
+// Include files for KDE
+
+#include <kdialogbase.h>
+#include "libkipi/libkipi_export.h"
+class KListView;
+class KProgress;
+
+/**
+ @namespace KIPI
+ This is the namespace
+*/
+namespace KIPI
+{
+
+class BatchProgressItem;
+
+enum ActionMessageType
+{
+ StartingMessage = 0,
+ SuccessMessage,
+ WarningMessage,
+ ErrorMessage,
+ ProgressMessage
+};
+
+class LIBKIPI_EXPORT BatchProgressDialog : public KDialogBase
+{
+Q_OBJECT
+
+ public:
+
+ BatchProgressDialog( QWidget *parent=0, const QString &caption=QString::null );
+ ~BatchProgressDialog();
+
+ void addedAction(const QString &text, int type);
+ void reset();
+ void setProgress(int current, int total);
+
+ protected:
+
+ KIPI::BatchProgressItem *m_item;
+ KListView *m_actionsList;
+ KProgress *m_progress;
+
+ private:
+
+ struct Private;
+ Private* d;
+};
+
+} // NameSpace KIPI
+
+#endif // BATCHPROGRESSDIALOG_H
diff --git a/libkipi/libkipi/design b/libkipi/libkipi/design
new file mode 100644
index 0000000..350b735
--- /dev/null
+++ b/libkipi/libkipi/design
@@ -0,0 +1,96 @@
+Suggested redesign of currentAlbum() / currentSelection() / allAlbums()
+=======================================================================
+
+Problem 1
+=========
+Plugins should be as similar as possible when it comes to user
+interaction. The topic for discussion here are what set of images does the
+plugin work on.
+
+Currently most KIPI plugins have been changed so that they use
+Interface::currentScope() which uses the selection if one exist, otherwise
+they use the currentAlbum if that exists.
+
+However, some plugins do not work like this, examples of alternative ways
+are:
+ - always use selection (set wall paper)
+ - ask what to use using a set of radio buttons ( can't remember which
+ does this)
+ - ask the user to select albums using check boxes.
+
+Problem 2
+=========
+Asking the user for an image set by the last method above only work well
+when the host application uses the concept of an Album - which KimDaBa
+doesn't.
+
+Solution - step 1
+=================
+
+Aurelien suggested the following solution, which works well when an
+application uses the concept of Albums:
+
+Replaces all the different ways above with a QListView showing the albums as
+returned by allAlbums(). The album returned by currentAlbum() would be
+selected by default.
+
+In the case of Gwenview, allAlbums() would return three virtual albums:
+- Selected images
+- All images in the current dir
+- All images in the current dir and subdirs
+
+In the case of KimDaBa, allAlbums() would return the list of keywords and a
+special "Any" keyword which would be contains the union of all the other
+keywords.
+
+Solution - step 2
+=================
+The above will seriously break with how KimDaBa approaches albums. A
+solution to this would be to make it up to the individual host applications
+to offer a browser for selecting images.
+
+The implementation would looks something like this:
+
+ class Interface {
+ ...
+ virtual Browser browser() = 0;
+ }
+
+ class Browser {
+ public:
+ Browser( BrowserShared* );
+ virtual QWidget* widget( QWidget* parent );
+ KURL::List images();
+
+ // all the other stuff to make a shared class.
+
+ signals:
+ void descriptionChanged( const QString& );
+ void previewChanged( const QPixmap& );
+ }
+
+ class BrowserShared {
+ public:
+ virtual QWidget* widget( QWidget* parent ) = 0;
+ KURL::List images() = 0;
+ signals:
+ ...
+ }
+
+The widget method should return the configuration widget, this might
+e.g. be the listview suggested by aurelien, or something else
+If the widget returned are 0, then the application do not want to offer any
+configuration, and the images must somehow be chosen before the plugin
+appears (This will be the case in KimDaBa).
+
+The images() method must return the selected images to operated on.
+
+The signals are for host application which offers dir==album, and have a
+description and preview for the dir (as is the case for digikam).
+
+The above replaces the currentAlbum(), currentSelection(), currentScope() and
+allAlbums() from KIPI::Interface.
+[Question: Should we remove these methods?]
+
+Also the ImageCollection class goes away.
+[Question: What do we do about uploadPath() and uploadURL().]
diff --git a/libkipi/libkipi/hi16-app-kipi.png b/libkipi/libkipi/hi16-app-kipi.png
new file mode 100644
index 0000000..a8e37b4
--- /dev/null
+++ b/libkipi/libkipi/hi16-app-kipi.png
Binary files differ
diff --git a/libkipi/libkipi/hi22-app-kipi.png b/libkipi/libkipi/hi22-app-kipi.png
new file mode 100644
index 0000000..00d0553
--- /dev/null
+++ b/libkipi/libkipi/hi22-app-kipi.png
Binary files differ
diff --git a/libkipi/libkipi/hi32-app-kipi.png b/libkipi/libkipi/hi32-app-kipi.png
new file mode 100644
index 0000000..05ce405
--- /dev/null
+++ b/libkipi/libkipi/hi32-app-kipi.png
Binary files differ
diff --git a/libkipi/libkipi/hi48-app-kipi.png b/libkipi/libkipi/hi48-app-kipi.png
new file mode 100644
index 0000000..655ea4d
--- /dev/null
+++ b/libkipi/libkipi/hi48-app-kipi.png
Binary files differ
diff --git a/libkipi/libkipi/imagecollection.cpp b/libkipi/libkipi/imagecollection.cpp
new file mode 100644
index 0000000..a499322
--- /dev/null
+++ b/libkipi/libkipi/imagecollection.cpp
@@ -0,0 +1,262 @@
+/* ============================================================
+ * File : imagecollection.cpp
+ * Authors: KIPI team developers (see AUTHORS files for details)
+ *
+ * Date : 2004-02
+ * Description :
+ *
+ * Copyright 2004 by the KIPI team
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Library General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * ============================================================ */
+
+// KDE includes.
+
+#include <kdebug.h>
+#include <klocale.h>
+
+// Local includes.
+
+#include "imagecollection.h"
+#include "imagecollectionshared.h"
+
+/**
+ @file imagecollection.cpp
+ returns the comment for the collection of images or QString::null if that doesn't make any sense.
+ A comment makes sense for an album, but not for a KIPI::Interface::currentSelection().
+*/
+QString KIPI::ImageCollection::comment() const
+{
+ if ( _data )
+ return _data->comment();
+ else {
+ printNullError();
+ return QString::null;
+ }
+}
+
+/**
+ PENDING(blackie) document
+*/
+QString KIPI::ImageCollection::name() const
+{
+ if ( _data )
+ return _data->name();
+ else {
+ printNullError();
+ return QString::null;
+ }
+}
+
+/**
+ Return the category of the image collection. For example in Digikam,
+ a category is a sorting class like 'travels', 'friends', 'monuments', etc.
+*/
+QString KIPI::ImageCollection::category() const
+{
+ if ( _data )
+ return _data->category();
+ else {
+ printNullError();
+ return QString::null;
+ }
+}
+
+/**
+ Return the Creation date of the image collection. The default implementation
+ return a null date.
+*/
+QDate KIPI::ImageCollection::date() const
+{
+ if ( _data )
+ return _data->date();
+ else {
+ printNullError();
+ return QDate();
+ }
+}
+
+/**
+ PENDING(blackie) document
+*/
+KURL::List KIPI::ImageCollection::images() const
+{
+ if ( _data )
+ return _data->images();
+ else {
+ printNullError();
+ return KURL::List();
+ }
+}
+
+KIPI::ImageCollection::ImageCollection( ImageCollectionShared* data )
+ : _data( data )
+{
+}
+
+KIPI::ImageCollection::~ImageCollection()
+{
+ if ( _data )
+ _data->removeRef();
+}
+
+KIPI::ImageCollection::ImageCollection( const ImageCollection& rhs )
+{
+ if ( rhs._data ) {
+ _data = rhs._data;
+ _data->addRef();
+ }
+ else
+ _data = 0;
+}
+
+KIPI::ImageCollection::ImageCollection()
+{
+ _data = 0;
+}
+
+KIPI::ImageCollection& KIPI::ImageCollection::operator=( const KIPI::ImageCollection& rhs )
+{
+ if ( rhs._data == _data )
+ return *this;
+
+ if ( _data )
+ _data->removeRef();
+ if ( !rhs._data ) {
+ printNullError();
+ _data = 0;
+ }
+ else {
+ _data = rhs._data;
+ _data->addRef();
+ }
+ return *this;
+}
+
+/*!
+ Returns the directory for the image collection.
+ The host application may, however, return anything in case this
+ imagecollection is not a directory (check isDirectory()), or may
+ return the directory of the first image in the collection, the root
+ of the image collection (in case all images has a common root), or
+ even an empty URL.
+*/
+KURL KIPI::ImageCollection::path() const
+{
+ if ( _data )
+ return _data->path();
+ else {
+ printNullError();
+ return KURL();
+ }
+}
+
+/*!
+ Returns the directory to place images into.
+ This function should only be called if KIPI::Features AcceptNewImages
+ is available.
+
+ The function may choose to return the directory for the image collection
+ or if images from the collection are not available in a common directory,
+ then instead a common upload directory.
+ In contrast to \ref path, this function must return a valid url.
+
+ <b>IMPORTANT:</b> uploadRoot() must be a subpath of uploadPath()
+*/
+KURL KIPI::ImageCollection::uploadPath() const
+{
+ if ( _data )
+ return _data->uploadPath();
+ else {
+ printNullError();
+ return KURL();
+ }
+}
+
+/*!
+ When a plugin wants to upload images, it may choose to display an upload widget,
+ which gives the user the possible to show a directory from a tree view.
+
+ This tree view widget needs to starts at some URL. This function specifies that location.
+ Here are a couble of possible return value different host applications may choose.
+ <ul>
+ <li> If all images are stored rooted at some tree (which is the case for
+ KimDaBa), then this function may return this directory unconditionally.
+ <li> The root directory returned by uploadPath() (which is the default implementation for this method)
+ <li> The directory returned by uploadPath().
+ </ul>
+
+ <b>IMPORTANT:</b> uploadRoot() must be a subpath of uploadPath()
+*/
+KURL KIPI::ImageCollection::uploadRoot() const
+{
+ if ( _data )
+ return _data->uploadRoot();
+ else {
+ printNullError();
+ return KURL();
+ }
+}
+
+/*!
+ This fonction return the name of the upload root path used by the
+ the KIPI::UploadWidget. This name can be different for each host
+ app (like "Images" for Kimdaba or "My Albums" for Digikam).
+*/
+QString KIPI::ImageCollection::uploadRootName() const
+{
+ if ( _data )
+ return _data->uploadRootName();
+ else {
+ printNullError();
+ return QString::null;
+ }
+}
+
+/*
+ Returns whether an imagecollection is a physical folder on the filesystem
+ or not. Its important to check this, if your plugin needs to do folder
+ based operations for an imagecollection
+*/
+bool KIPI::ImageCollection::isDirectory() const
+{
+ if ( _data )
+ return _data->isDirectory();
+ else {
+ printNullError();
+ return false;
+ }
+}
+
+bool KIPI::ImageCollection::isValid() const
+{
+ return (_data != 0);
+}
+
+void KIPI::ImageCollection::printNullError() const
+{
+ kdWarning( 51000 ) << "Image collection is invalid - this might be the case if you asked for an album, " << endl
+ << "and not album existed. You should check using .isValid() first." << endl
+ << "Notice: Plugins should never create an instance of ImageCollection, only the host application "
+ << "should do that." << endl;
+}
+
+
+bool KIPI::ImageCollection::operator==(const KIPI::ImageCollection& ic) const {
+ if (!_data || !(ic._data))
+ {
+ printNullError();
+ return false;
+ }
+ return *_data == *(ic._data);
+}
diff --git a/libkipi/libkipi/imagecollection.h b/libkipi/libkipi/imagecollection.h
new file mode 100644
index 0000000..b30f9f3
--- /dev/null
+++ b/libkipi/libkipi/imagecollection.h
@@ -0,0 +1,76 @@
+/* ============================================================
+ * File : imagecollection.h
+ * Authors: KIPI team developers (see AUTHORS files for details)
+ *
+ * Date : 2004-02
+ * Description :
+ *
+ * Copyright 2004 by the KIPI team
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Library General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * ============================================================ */
+
+/** @file imagecollection.h */
+
+#ifndef KIPI_IMAGECOLLECTION_H
+#define KIPI_IMAGECOLLECTION_H
+
+// Qt includes
+
+#include <qstring.h>
+#include <qdatetime.h>
+
+// KDE includes.
+
+#include <kurl.h>
+#include "libkipi/libkipi_export.h"
+
+/** @namespace KIPI */
+namespace KIPI
+{
+ class ImageCollectionShared;
+
+ /** @class ImageCollection
+ Holds info about the collection
+ */
+ class LIBKIPI_EXPORT ImageCollection
+ {
+ public:
+ QString name() const;
+ QString comment() const;
+ QString category() const;
+ QDate date() const;
+ KURL::List images() const;
+ KURL path() const;
+ KURL uploadPath() const;
+ KURL uploadRoot() const;
+ QString uploadRootName() const;
+ bool isDirectory() const;
+ bool isValid() const;
+
+ // Interface for host application + general stuff
+ ImageCollection( ImageCollectionShared* );
+ ImageCollection( const ImageCollection& other );
+ ~ImageCollection();
+ ImageCollection();
+ ImageCollection& operator=( const ImageCollection& );
+
+ bool operator==(const ImageCollection&) const;
+ private:
+ mutable KIPI::ImageCollectionShared* _data;
+ void printNullError() const;
+ };
+}
+
+#endif /* IMAGECOLLECTION_H */
+
diff --git a/libkipi/libkipi/imagecollectionselector.cpp b/libkipi/libkipi/imagecollectionselector.cpp
new file mode 100644
index 0000000..c8a8625
--- /dev/null
+++ b/libkipi/libkipi/imagecollectionselector.cpp
@@ -0,0 +1,348 @@
+/* ============================================================
+ * File : imagecollectionselector.cpp
+ * Authors: KIPI team developers (see AUTHORS files for details)
+ *
+ * Date : 2004-07
+ * Description :
+ *
+ * Copyright 2004 by the KIPI team
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Library General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * ============================================================ */
+
+// Qt includes.
+
+#include <qheader.h>
+#include <qlayout.h>
+#include <qpushbutton.h>
+#include <qlabel.h>
+#include <qvgroupbox.h>
+#include <qtimer.h>
+
+// KDE includes.
+
+#include <kbuttonbox.h>
+#include <kdialog.h>
+#include <klistview.h>
+#include <klocale.h>
+#include <kglobal.h>
+#include <kio/previewjob.h>
+
+// KIPI includes.
+
+#include "libkipi/interface.h"
+
+// Local includes.
+
+#include "imagecollectionselector.h"
+
+namespace KIPI
+{
+
+class ImageCollectionItem : public QCheckListItem
+{
+public:
+ ImageCollectionItem(ImageCollectionSelector* selector,
+ QListView * parent, ImageCollection collection)
+ : QCheckListItem( parent, collection.name(), QCheckListItem::CheckBox),
+ _imageCollection(collection), _selector(selector)
+ {}
+
+ ImageCollection imageCollection() const { return _imageCollection; }
+
+protected:
+
+ virtual void stateChange(bool val)
+ {
+ QCheckListItem::stateChange(val);
+ _selector->emitSelectionChanged();
+ }
+
+private:
+
+ ImageCollection _imageCollection;
+ ImageCollectionSelector* _selector;
+};
+
+struct ImageCollectionSelector::Private {
+ Interface* _interface;
+ KListView* _list;
+ QLabel* _thumbLabel;
+ QLabel* _textLabel;
+ QListViewItem* _itemToSelect;
+};
+
+
+ImageCollectionSelector::ImageCollectionSelector(QWidget* parent, Interface* interface, const char* name)
+ : QWidget(parent, name)
+{
+ d=new Private;
+ d->_interface=interface;
+ d->_itemToSelect = 0;
+
+ d->_list=new KListView(this);
+ d->_list->setResizeMode( QListView::LastColumn );
+ d->_list->addColumn("");
+ d->_list->header()->hide();
+
+ connect(d->_list, SIGNAL(selectionChanged(QListViewItem*)),
+ SLOT(slotSelectionChanged(QListViewItem*)));
+
+ QHBoxLayout* mainLayout=new QHBoxLayout(this, 0, KDialog::spacingHint());
+ mainLayout->addWidget(d->_list);
+
+ QVBoxLayout* rightLayout = new QVBoxLayout(mainLayout, 0);
+
+ KButtonBox* box=new KButtonBox(this, Vertical);
+ rightLayout->addWidget(box);
+ QPushButton* selectAll=box->addButton(i18n("Select All"));
+ QPushButton* invertSelection=box->addButton(i18n("Invert Selection"));
+ QPushButton* selectNone=box->addButton(i18n("Select None"));
+ box->layout();
+
+ connect(selectAll, SIGNAL(clicked()),
+ this, SLOT(slotSelectAll()) );
+ connect(invertSelection, SIGNAL(clicked()),
+ this, SLOT(slotInvertSelection()) );
+ connect(selectNone, SIGNAL(clicked()),
+ this, SLOT(slotSelectNone()) );
+
+ rightLayout->addItem(new QSpacerItem(10,20,QSizePolicy::Fixed,
+ QSizePolicy::Expanding));
+
+ QVGroupBox* rightBox = new QVGroupBox(this);
+ rightBox->setInsideMargin(KDialog::marginHint());
+ rightBox->setInsideSpacing(KDialog::spacingHint());
+ rightLayout->addWidget(rightBox);
+
+ if (interface->hasFeature(AlbumsUseFirstImagePreview))
+ {
+ d->_thumbLabel = new QLabel(rightBox);
+ d->_thumbLabel->setFixedSize(QSize(128,128));
+ d->_thumbLabel->setAlignment(AlignHCenter | AlignVCenter);
+ }
+ else
+ {
+ d->_thumbLabel = 0;
+ }
+ d->_textLabel = new QLabel(rightBox);
+
+ fillList();
+ QTimer::singleShot(0, this, SLOT(slotInitialShow()));
+}
+
+
+ImageCollectionSelector::~ImageCollectionSelector() {
+ delete d;
+}
+
+
+void ImageCollectionSelector::fillList() {
+ QValueList<ImageCollection> collections = d->_interface->allAlbums();
+ d->_list->clear();
+ ImageCollection current = d->_interface->currentAlbum();
+ bool currentWasInList = false;
+
+ /* note: the extensive use of blocksignals is to prevent bombarding
+ the plugin with too many selection changed signals. do not remove
+ them */
+
+ blockSignals(true);
+ for( QValueList<ImageCollection>::Iterator it = collections.begin() ;
+ it != collections.end() ; ++it )
+ {
+ ImageCollectionItem* item = new ImageCollectionItem( this, d->_list, *it);
+ if (!currentWasInList && *it == current) {
+ item->setOn(true);
+ currentWasInList = true;
+ if (!d->_itemToSelect)
+ d->_itemToSelect = item;
+ }
+ }
+
+ if (!currentWasInList) {
+ slotSelectAll();
+ d->_itemToSelect = d->_list->firstChild();
+ }
+ blockSignals(false);
+}
+
+void ImageCollectionSelector::emitSelectionChanged()
+{
+ emit selectionChanged();
+}
+
+QValueList<ImageCollection> ImageCollectionSelector::selectedImageCollections() const {
+ QValueList<ImageCollection> list;
+
+ QListViewItemIterator it( d->_list );
+
+ for (; it.current(); ++it) {
+ ImageCollectionItem *item = static_cast<ImageCollectionItem*>( it.current() );
+
+ if (item->isOn()) {
+ list << item->imageCollection();
+ }
+ }
+
+ return list;
+}
+
+void ImageCollectionSelector::slotSelectAll() {
+ QListViewItemIterator it( d->_list );
+
+ /* note: the extensive use of blocksignals is to prevent bombarding
+ the plugin with too many selection changed signals. do not remove
+ them */
+ blockSignals(true);
+ for (; it.current(); ++it) {
+ ImageCollectionItem *item = static_cast<ImageCollectionItem*>( it.current() );
+ item->setOn(true);
+ }
+ blockSignals(false);
+
+ emit selectionChanged();
+}
+
+
+void ImageCollectionSelector::slotInvertSelection() {
+ QListViewItemIterator it( d->_list );
+
+ /* note: the extensive use of blocksignals is to prevent bombarding
+ the plugin with too many selection changed signals. do not remove
+ them */
+ blockSignals(true);
+ for (; it.current(); ++it) {
+ ImageCollectionItem *item = static_cast<ImageCollectionItem*>( it.current() );
+ item->setOn(!item->isOn());
+ }
+ blockSignals(false);
+
+ emit selectionChanged();
+}
+
+
+void ImageCollectionSelector::slotSelectNone() {
+ QListViewItemIterator it( d->_list );
+
+ /* note: the extensive use of blocksignals is to prevent bombarding
+ the plugin with too many selection changed signals. do not remove
+ them */
+ blockSignals(true);
+ for (; it.current(); ++it) {
+ ImageCollectionItem *item = static_cast<ImageCollectionItem*>( it.current() );
+ item->setOn(false);
+ }
+ blockSignals(false);
+
+ emit selectionChanged();
+}
+
+void ImageCollectionSelector::slotSelectionChanged(QListViewItem* listItem)
+{
+ if (d->_thumbLabel)
+ d->_thumbLabel->clear();
+ d->_textLabel->clear();
+
+ if (!listItem)
+ return;
+
+ ImageCollectionItem* imcollItem =
+ static_cast<ImageCollectionItem*>(listItem);
+
+ if (d->_thumbLabel)
+ {
+ KURL::List images(imcollItem->imageCollection().images());
+ if (!images.isEmpty())
+ {
+ KIO::PreviewJob* thumbJob = KIO::filePreview(images.first(), 128);
+ connect( thumbJob, SIGNAL(gotPreview(const KFileItem*, const QPixmap&)),
+ SLOT(slotGotPreview(const KFileItem* , const QPixmap&)));
+ }
+ }
+
+ // Layout the ImageCollection information nicely
+
+ QString cellBeg("<tr><td><nobr><font size=-1><i>");
+ QString cellMid("</i></font></nobr></td><td><font size=-1>");
+ QString cellEnd("</font></td></tr>");
+
+ QString text("<table cellspacing=0 cellpadding=0>");
+
+ // number of images
+ text += cellBeg + i18n("Images:") +
+ cellMid + QString::number(imcollItem->imageCollection().images().count()) +
+ cellEnd;
+
+ // Optional features -------------------------------------------------------
+
+ // Album Comments
+ if (d->_interface->hasFeature(AlbumsHaveComments))
+ {
+ // Limit the comments string to 20 char...
+ QString comments = imcollItem->imageCollection().comment();
+ if (!comments.isEmpty())
+ {
+ comments.truncate(20);
+ comments.append("...");
+ }
+
+ text += cellBeg + i18n("Comments:") +
+ cellMid + comments +
+ cellEnd;
+ }
+
+ // Album Category
+ if (d->_interface->hasFeature(AlbumsHaveCategory))
+ {
+ text += cellBeg + i18n("Category:") +
+ cellMid + imcollItem->imageCollection().category() +
+ cellEnd;
+ }
+
+ // Album Creation Date
+ if (d->_interface->hasFeature(AlbumsHaveCreationDate))
+ {
+ QDate date(imcollItem->imageCollection().date());
+ text += cellBeg + i18n("Date:") +
+ cellMid + KGlobal::locale()->formatDate(date) +
+ cellEnd;
+ }
+
+
+ text += "</table>";
+
+ d->_textLabel->setText(text);
+
+ emit selectionChanged();
+}
+
+void ImageCollectionSelector::slotGotPreview(const KFileItem*, const QPixmap& pix)
+{
+ d->_thumbLabel->setPixmap(pix);
+}
+
+void ImageCollectionSelector::slotInitialShow()
+{
+ if (d->_itemToSelect)
+ {
+ d->_list->setSelected(d->_itemToSelect, true);
+ d->_list->ensureItemVisible(d->_itemToSelect);
+ d->_itemToSelect = 0;
+ }
+ emit selectionChanged();
+}
+
+} // KIPI
+
+#include "imagecollectionselector.moc"
diff --git a/libkipi/libkipi/imagecollectionselector.h b/libkipi/libkipi/imagecollectionselector.h
new file mode 100644
index 0000000..fd7a6ae
--- /dev/null
+++ b/libkipi/libkipi/imagecollectionselector.h
@@ -0,0 +1,81 @@
+/* ============================================================
+ * File : imagecollectionselector.h
+ * Authors: KIPI team developers (see AUTHORS files for details)
+ *
+ * Date : 2004-07
+ * Description :
+ *
+ * Copyright 2004 by the KIPI team
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Library General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * ============================================================ */
+
+#ifndef IMAGECOLLECTIONSELECTOR_H
+#define IMAGECOLLECTIONSELECTOR_H
+
+// Qt includes.
+
+#include <qwidget.h>
+#include <qvaluelist.h>
+#include <qpixmap.h>
+
+// KIPI includes.
+
+#include "libkipi/imagecollection.h"
+#include "libkipi/libkipi_export.h"
+
+class QListViewItem;
+class KFileItem;
+
+namespace KIPI
+{
+
+class Interface;
+
+class LIBKIPI_EXPORT ImageCollectionSelector : public QWidget
+{
+Q_OBJECT
+ class Private;
+
+public:
+
+ ImageCollectionSelector(QWidget* parent, Interface*, const char* name=0);
+ ~ImageCollectionSelector();
+
+ QValueList<ImageCollection> selectedImageCollections() const;
+
+signals:
+
+ void selectionChanged(void);
+
+private:
+
+ Private* d;
+ void fillList();
+ void emitSelectionChanged();
+ friend class ImageCollectionItem;
+
+private slots:
+
+ void slotSelectAll();
+ void slotInvertSelection();
+ void slotSelectNone();
+ void slotSelectionChanged(QListViewItem* listItem);
+ void slotGotPreview(const KFileItem*, const QPixmap&);
+ void slotInitialShow();
+};
+
+} // KIPI
+
+
+#endif /* IMAGECOLLECTIONSELECTOR_H */
diff --git a/libkipi/libkipi/imagecollectionshared.cpp b/libkipi/libkipi/imagecollectionshared.cpp
new file mode 100644
index 0000000..c8ebd37
--- /dev/null
+++ b/libkipi/libkipi/imagecollectionshared.cpp
@@ -0,0 +1,116 @@
+/* ============================================================
+ * File : imagecollectionshared.cpp
+ * Authors: KIPI team developers (see AUTHORS files for details)
+ *
+ * Date : 2004-02
+ * Description :
+ *
+ * Copyright 2004 by the KIPI team
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Library General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * ============================================================ */
+
+// KDE Includes.
+
+#include <klocale.h>
+#include <kdebug.h>
+
+// Local Includes.
+
+#include "imagecollectionshared.h"
+
+
+KIPI::ImageCollectionShared::ImageCollectionShared()
+ : _count(1)
+{
+}
+
+void KIPI::ImageCollectionShared::addRef()
+{
+ _count++;
+}
+
+void KIPI::ImageCollectionShared::removeRef()
+{
+ _count--;
+ if ( _count == 0 ) {
+ // qDebug("Deleting!");
+ delete this;
+ }
+}
+
+KURL KIPI::ImageCollectionShared::path()
+{
+ kdWarning(51000) << "This method should only be invoked if this imagecollection is a directory.\n"
+ << "See KIPI::ImageCollectionShared::isDirectory()"
+ << endl;
+ return KURL();
+}
+
+KURL KIPI::ImageCollectionShared::uploadPath()
+{
+ kdWarning(51000) << "This method should only be invoked if the host application supports the KIPI::Features\n"
+ "AcceptNewImages - if the host application do support that, then this function should\n"
+ "have been overriden in the host application.\n";
+ return KURL();
+}
+
+KURL KIPI::ImageCollectionShared::uploadRoot()
+{
+ KURL path = uploadPath();
+ if ( path.isValid() ) {
+ path.setPath("/");
+ return path;
+ }
+ else
+ return KURL( "file:/" );
+}
+
+QString KIPI::ImageCollectionShared::uploadRootName()
+{
+ return (i18n("Images"));
+}
+
+bool KIPI::ImageCollectionShared::isDirectory()
+{
+ return false;
+}
+
+QString KIPI::ImageCollectionShared::comment()
+{
+ kdWarning(51000) << "KIPI::ImageCollectionShared::comment should only be invoked if the host application supports\n"
+ "the KIPI::Features AlbumsHaveComments - if the host application do support that, then this function should\n"
+ "have been overriden in the host application.\n";
+ return QString::null;
+}
+
+QString KIPI::ImageCollectionShared::category()
+{
+ kdWarning(51000) << "KIPI::ImageCollectionShared::category should only be invoked if the host application supports\n"
+ "the KIPI::Features AlbumsHaveCategory - if the host application do support that, then this function should\n"
+ "have been overriden in the host application.\n";
+ return QString::null;
+}
+
+QDate KIPI::ImageCollectionShared::date()
+{
+ kdWarning(51000) << "KIPI::ImageCollectionShared::date should only be invoked if the host application supports\n"
+ "the KIPI::Features AlbumsHaveCreationDate - if the host application do support that, then this function should\n"
+ "have been overriden in the host application.\n";
+ return QDate();
+}
+
+
+bool KIPI::ImageCollectionShared::operator==(ImageCollectionShared& ics) {
+ return images()==ics.images();
+}
diff --git a/libkipi/libkipi/imagecollectionshared.h b/libkipi/libkipi/imagecollectionshared.h
new file mode 100644
index 0000000..6a03d4e
--- /dev/null
+++ b/libkipi/libkipi/imagecollectionshared.h
@@ -0,0 +1,68 @@
+/* ============================================================
+ * File : imagecollectionshared.h
+ * Authors: KIPI team developers (see AUTHORS files for details)
+ *
+ * Date : 2004-02
+ * Description :
+ *
+ * Copyright 2004 by the KIPI team
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Library General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * ============================================================ */
+
+#ifndef KIPI_IMAGECOLLECTIONSHARED_H
+#define KIPI_IMAGECOLLECTIONSHARED_H
+
+// Qt Includes.
+
+#include <qstring.h>
+#include <qdatetime.h>
+
+// KDE includes.
+
+#include <kurl.h>
+
+// Local includes.
+
+#include "imagecollection.h"
+#include "libkipi/libkipi_export.h"
+
+namespace KIPI
+{
+ class LIBKIPI_EXPORT ImageCollectionShared
+ {
+ public:
+ ImageCollectionShared();
+ virtual ~ImageCollectionShared() {}
+ virtual QString name() = 0;
+ virtual QString comment();
+ virtual QString category();
+ virtual QDate date();
+ virtual KURL::List images() = 0;
+ virtual KURL path();
+ virtual KURL uploadPath();
+ virtual KURL uploadRoot();
+ virtual QString uploadRootName();
+ virtual bool isDirectory();
+ virtual bool operator==(ImageCollectionShared&);
+
+ private:
+ friend class ImageCollection;
+ void addRef();
+ void removeRef();
+ int _count;
+ };
+}
+
+#endif /* IMAGECOLLECTIONSHARED_H */
+
diff --git a/libkipi/libkipi/imagedialog.cpp b/libkipi/libkipi/imagedialog.cpp
new file mode 100644
index 0000000..da5344d
--- /dev/null
+++ b/libkipi/libkipi/imagedialog.cpp
@@ -0,0 +1,327 @@
+/* ============================================================
+ * File : imagedialog.cpp
+ * Authors: KIPI team developers (see AUTHORS files for details)
+ *
+ * Date : 2004-05
+ * Description : an image files selector dialog.
+ *
+ * Copyright 2004 by the KIPI team
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Library General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * ============================================================ */
+
+// Qt includes.
+
+#include <qguardedptr.h>
+#include <qlabel.h>
+#include <qsplitter.h>
+#include <qlayout.h>
+#include <qframe.h>
+#include <qpushbutton.h>
+#include <qtimer.h>
+
+// KDE includes.
+
+#include <kdebug.h>
+#include <klistview.h>
+#include <klocale.h>
+#include <kstandarddirs.h>
+#include <kio/previewjob.h>
+#include <kapplication.h>
+#include <kaboutdata.h>
+#include <khelpmenu.h>
+#include <kiconloader.h>
+#include <kpopupmenu.h>
+
+// Include files for libKipi.
+
+#include "libkipi/version.h"
+
+// Local includes.
+
+#include "imagedialog.h"
+
+const int PREVIEW_SIZE = 128;
+
+namespace KIPI
+{
+
+struct AlbumLVI : public KListViewItem {
+ AlbumLVI(KListView* parent, const KIPI::ImageCollection& album)
+ : KListViewItem(parent, album.name())
+ , _album(album) {}
+
+ const KIPI::ImageCollection& _album;
+};
+
+
+struct ImageLVI : public KListViewItem {
+ ImageLVI(KListView* parent, const KURL& url)
+ : KListViewItem(parent, url.fileName()), _url(url) {}
+
+ KURL _url;
+};
+
+
+struct ImageDialog::Private {
+ KURL _url;
+ KURL::List _urls;
+ KIPI::Interface* _interface;
+ KListView* _albumList;
+ KListView* _imageList;
+ QLabel* _preview;
+ QValueList<ImageCollection> _albums;
+ bool _singleSelection;
+};
+
+
+ImageDialog::ImageDialog(QWidget* parent, KIPI::Interface* interface,
+ bool singleSelection)
+ : KDialogBase(KDialogBase::Plain, i18n("Select Image From Album"), Help|Ok|Cancel,
+ Ok, parent, "album-dialog", true, true)
+{
+ d = new Private;
+ d->_interface=interface;
+ d->_singleSelection = singleSelection;
+
+ QWidget* box = plainPage();
+ QVBoxLayout *dvlay = new QVBoxLayout( box, 6 );
+
+ //---------------------------------------------
+
+ QFrame *headerFrame = new QFrame( box );
+ headerFrame->setFrameStyle(QFrame::Panel|QFrame::Sunken);
+ QHBoxLayout* layout = new QHBoxLayout( headerFrame );
+ layout->setMargin( 2 ); // to make sure the frame gets displayed
+ layout->setSpacing( 0 );
+ QLabel *pixmapLabelLeft = new QLabel( headerFrame, "pixmapLabelLeft" );
+ pixmapLabelLeft->setScaledContents( false );
+ layout->addWidget( pixmapLabelLeft );
+ QLabel *labelTitle = new QLabel( i18n("Select Image From Album"), headerFrame, "labelTitle" );
+ layout->addWidget( labelTitle );
+ layout->setStretchFactor( labelTitle, 1 );
+ dvlay->addWidget( headerFrame );
+
+ QString directory;
+ KGlobal::dirs()->addResourceType("kipi_banner_left", KGlobal::dirs()->kde_default("data") + "kipi/data");
+ directory = KGlobal::dirs()->findResourceDir("kipi_banner_left", "banner_left.png");
+
+ pixmapLabelLeft->setPaletteBackgroundColor( QColor(201, 208, 255) );
+ pixmapLabelLeft->setPixmap( QPixmap( directory + "banner_left.png" ) );
+ labelTitle->setPaletteBackgroundColor( QColor(201, 208, 255) );
+
+ //---------------------------------------------
+
+ // About data and help button.
+
+ KAboutData* about = new KAboutData("kipiplugins",
+ I18N_NOOP("Image selector dialog"),
+ kipi_version,
+ I18N_NOOP("A Kipi dialog for image selection"),
+ KAboutData::License_GPL,
+ "(c) 2004,2005, Kipi development team",
+ 0,
+ "http://extragear.kde.org/apps/kipi");
+
+ QPushButton *helpButton = actionButton( Help );
+ KHelpMenu* helpMenu = new KHelpMenu(this, about, false);
+ helpMenu->menu()->removeItemAt(0);
+ helpMenu->menu()->insertItem(i18n("Kipi Plugins Handbooks"), this, SLOT(slotHelp()), 0, -1, 0);
+ helpButton->setPopup( helpMenu->menu() );
+
+ //---------------------------------------------
+
+ QSplitter* splitter = new QSplitter(box);
+
+ d->_albumList=new KListView(splitter);
+ d->_albumList->addColumn(i18n("Album Name"));
+ d->_albumList->setMinimumWidth(200);
+ d->_albumList->setResizeMode(QListView::LastColumn);
+
+ d->_imageList=new KListView(splitter);
+ d->_imageList->addColumn(i18n("Image Name"));
+ d->_imageList->setMinimumWidth(200);
+ d->_imageList->setSelectionMode(singleSelection ? QListView::Single :
+ QListView::Extended);
+ d->_imageList->setResizeMode(QListView::LastColumn);
+
+ d->_preview=new QLabel(splitter);
+ d->_preview->setAlignment(AlignHCenter | AlignVCenter | WordBreak);
+ d->_preview->setFixedWidth(PREVIEW_SIZE);
+ d->_preview->setText(i18n("No image selected"));
+
+ dvlay->addWidget( splitter );
+
+ d->_albums=d->_interface->allAlbums();
+ QValueList<ImageCollection>::ConstIterator it=d->_albums.begin();
+
+ for(; it!=d->_albums.end(); ++it) {
+ new AlbumLVI(d->_albumList, *it);
+ }
+ QTimer::singleShot(0, this, SLOT(slotInitialShow()));
+
+ connect(d->_albumList, SIGNAL(selectionChanged(QListViewItem*)),
+ this, SLOT(fillImageList(QListViewItem*)) );
+
+ if (singleSelection)
+ connect(d->_imageList, SIGNAL(selectionChanged(QListViewItem*)),
+ this, SLOT(slotImageSelected(QListViewItem*)) );
+ else
+ connect(d->_imageList, SIGNAL(selectionChanged()),
+ this, SLOT(slotImagesSelected()));
+
+ enableButtonOK(false);
+}
+
+
+ImageDialog::~ImageDialog() {
+ delete d;
+}
+
+
+KURL ImageDialog::url() const {
+ return d->_url;
+}
+
+KURL::List ImageDialog::urls() const
+{
+ return d->_urls;
+}
+
+KURL ImageDialog::getImageURL(QWidget* parent, KIPI::Interface* interface) {
+ ImageDialog dlg(parent, interface, true);
+ if (dlg.exec() == QDialog::Accepted) {
+ return dlg.url();
+ } else {
+ return KURL();
+ }
+}
+
+KURL::List ImageDialog::getImageURLs(QWidget* parent, Interface* interface)
+{
+ ImageDialog dlg(parent, interface, false);
+ if (dlg.exec() == QDialog::Accepted)
+ return dlg.urls();
+ else
+ {
+ KURL::List urls;
+ return urls;
+ }
+}
+
+
+void ImageDialog::fillImageList(QListViewItem* item) {
+ d->_imageList->clear();
+ if (!item) return;
+
+ const KIPI::ImageCollection& album=static_cast<AlbumLVI*>(item)->_album;
+ KURL::List images=album.images();
+
+ KURL::List::ConstIterator it=images.begin();
+ for (;it!=images.end(); ++it) {
+ new ImageLVI(d->_imageList, *it);
+ }
+}
+
+
+void ImageDialog::slotImageSelected(QListViewItem* item) {
+ if (!item) {
+ enableButtonOK(false);
+ d->_preview->setText(i18n("No image selected"));
+ d->_url=KURL();
+ return;
+ }
+ enableButtonOK(true);
+ d->_url=static_cast<ImageLVI*>(item)->_url;
+ d->_preview->clear();
+
+ KIO::PreviewJob* thumbJob = KIO::filePreview(d->_url, PREVIEW_SIZE);
+ connect( thumbJob, SIGNAL(gotPreview(const KFileItem*, const QPixmap&)),
+ SLOT(slotGotPreview(const KFileItem* , const QPixmap&)));
+}
+
+void ImageDialog::slotImagesSelected()
+{
+ d->_url = KURL();
+ d->_urls.clear();
+ d->_preview->clear();
+
+ QListViewItem* selectedItem = 0;
+ QListViewItem* listItem = d->_imageList->firstChild();
+ while (listItem)
+ {
+ if (listItem->isSelected())
+ {
+ selectedItem = listItem;
+ d->_urls.append(static_cast<ImageLVI*>(listItem)->_url);
+ }
+ listItem = listItem->nextSibling();
+ }
+
+ if (!selectedItem)
+ {
+ enableButtonOK(false);
+ d->_preview->setText(i18n("No images selected"));
+ d->_url=KURL();
+ d->_urls.clear();
+ return;
+ }
+
+ enableButtonOK(true);
+
+ if (d->_urls.count() == 1)
+ {
+ d->_url = d->_urls.first();
+
+ KIO::PreviewJob* thumbJob = KIO::filePreview(d->_url, PREVIEW_SIZE);
+ connect( thumbJob, SIGNAL(gotPreview(const KFileItem*, const QPixmap&)),
+ SLOT(slotGotPreview(const KFileItem* , const QPixmap&)));
+ }
+ else
+ {
+ d->_url = d->_urls.first();
+ d->_preview->setText(i18n("1 image selected", "%n images selected", d->_urls.count()));
+ }
+}
+
+void ImageDialog::slotGotPreview(const KFileItem*, const QPixmap& pix) {
+
+ d->_preview->setPixmap(pix);
+}
+
+void ImageDialog::slotHelp( void )
+{
+ KApplication::kApplication()->invokeHelp("", "kipi-plugins");
+}
+
+void ImageDialog::slotInitialShow()
+{
+ ImageCollection current = d->_interface->currentAlbum();
+
+ QListViewItemIterator it( d->_albumList );
+ while ( it.current() )
+ {
+ AlbumLVI* lvi = static_cast<AlbumLVI*>( it.current() );
+ if ( lvi->_album == current )
+ {
+ d->_albumList->ensureItemVisible( lvi );
+ d->_albumList->setSelected( lvi, true );
+ break;
+ }
+ ++it;
+ }
+}
+
+} // namespace KIPI
+
+#include "imagedialog.moc"
diff --git a/libkipi/libkipi/imagedialog.h b/libkipi/libkipi/imagedialog.h
new file mode 100644
index 0000000..d23419c
--- /dev/null
+++ b/libkipi/libkipi/imagedialog.h
@@ -0,0 +1,83 @@
+/* ============================================================
+ * File : imagedialog.h
+ * Authors: KIPI team developers (see AUTHORS files for details)
+ *
+ * Date : 2004-05
+ * Description : an image files selector dialog.
+ *
+ * Copyright 2004 by the KIPI team
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Library General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * ============================================================ */
+
+#ifndef IMAGEDIALOG_H
+#define IMAGEDIALOG_H
+
+// Qt includes.
+
+#include <qvaluelist.h>
+#include <qwidget.h>
+
+// KDE includes.
+
+#include <kurl.h>
+#include <kdialogbase.h>
+
+// LibKipi includes.
+
+#include "libkipi/interface.h"
+#include "libkipi/imagecollection.h"
+#include "libkipi/libkipi_export.h"
+
+class QListViewItem;
+
+class KFileItem;
+class KListView;
+
+namespace KIPI
+{
+
+
+class LIBKIPI_EXPORT ImageDialog : public KDialogBase
+{
+Q_OBJECT
+
+ class Private;
+
+public:
+
+ ImageDialog(QWidget*, Interface*, bool singleSelection=false);
+ ~ImageDialog();
+
+ KURL url() const;
+ KURL::List urls() const;
+
+ static KURL getImageURL(QWidget*, Interface*);
+ static KURL::List getImageURLs(QWidget*, Interface*);
+
+private slots:
+
+ void fillImageList(QListViewItem*);
+ void slotImageSelected(QListViewItem*);
+ void slotImagesSelected();
+ void slotGotPreview(const KFileItem* , const QPixmap&);
+ void slotHelp( void );
+ void slotInitialShow();
+
+private:
+ Private* d;
+};
+
+} // namespace KIPI
+
+#endif /* IMAGECOLLECTIONDIALOG_H */
diff --git a/libkipi/libkipi/imageinfo.cpp b/libkipi/libkipi/imageinfo.cpp
new file mode 100644
index 0000000..536dbf3
--- /dev/null
+++ b/libkipi/libkipi/imageinfo.cpp
@@ -0,0 +1,169 @@
+/* ============================================================
+ * File : imageinfo.h
+ * Author: KIPI team developers (see AUTHORS files for details)
+ * Date : 2004-07-22
+ * Description :
+ *
+ * Copyright 2004 by the KIPI team
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Library General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * ============================================================ */
+
+#include "imageinfo.h"
+#include "KDStream.h"
+#include "imageinfoshared.h"
+
+/** @file imageinfo.cpp
+*/
+QString KIPI::ImageInfo::toString( const QVariant& data ) const
+{
+ QString string;
+ KDStream stream( &string );
+ stream << data
+ << flush ;
+ return string;
+}
+
+/**
+ PENDING(blackie) document
+*/
+QString KIPI::ImageInfo::title() const
+{
+ return _data->title();
+}
+
+/**
+ PENDING(blackie) document
+*/
+KURL KIPI::ImageInfo::path() const
+{
+ return _data->path();
+}
+
+/**
+ PENDING(blackie) document
+*/
+QString KIPI::ImageInfo::description() const
+{
+ return _data->description();
+}
+
+/**
+ Returns the time of the image.
+ In case the host application supports time range, the spec argument
+ specifies if it is the start or end time that should be returned.
+*/
+QDateTime KIPI::ImageInfo::time( TimeSpec spec ) const
+{
+ return _data->time( spec );
+}
+
+/**
+ Returns a Map of attributes of the image
+ In case the host application supports some special attributes of the image
+ this function can be used to return them.
+ Tags are supported by this feature: "tags" key contains QStringList()
+ encapsulated in a QVariant
+
+*/
+QMap<QString,QVariant> KIPI::ImageInfo::attributes() const
+{
+ return _data->attributes();
+}
+
+/**
+ PENDING(blackie) document
+*/
+int KIPI::ImageInfo::size() const
+{
+ return _data->size();
+}
+
+KIPI::ImageInfo::ImageInfo( ImageInfoShared* shared )
+ : _data( shared )
+{
+}
+
+KIPI::ImageInfo::ImageInfo( const KIPI::ImageInfo& rhs )
+{
+ _data = rhs._data;
+ _data->addRef();
+}
+
+KIPI::ImageInfo::~ImageInfo()
+{
+ _data->removeRef();
+}
+
+void KIPI::ImageInfo::setTitle( const QString& name )
+{
+ _data->setTitle( name );
+}
+
+void KIPI::ImageInfo::setDescription( const QString& description )
+{
+ _data->setDescription( description );
+}
+
+void KIPI::ImageInfo::clearAttributes()
+{
+ _data->clearAttributes();
+}
+
+void KIPI::ImageInfo::addAttributes( const QMap<QString,QVariant>& attributes )
+{
+ _data->addAttributes( attributes );
+}
+
+/**
+ Returns the angle the application rotates the image with when displaying it.
+ Certain host applications may choose to rotate the image on disk, and will always return 0,
+ while other host application will rotate the image when displaying it, and will thus not rotate
+ the image on disk.
+*/
+int KIPI::ImageInfo::angle() const
+{
+ return _data->angle();
+}
+
+/**
+ See \ref angle
+*/
+void KIPI::ImageInfo::setAngle( int angle )
+{
+ _data->setAngle( angle );
+}
+
+/**
+ In the case the application supports time ranges (like this image is
+ from 1998-2000), this method will return true if the time is an exact
+ specification, and thus not a range.
+*/
+bool KIPI::ImageInfo::isTimeExact() const
+{
+ return _data->isTimeExact();
+}
+
+void KIPI::ImageInfo::setTime( const QDateTime& time, TimeSpec spec )
+{
+ _data->setTime( time, spec );
+}
+
+/**
+ Copies all the attibutes, description etc from the other imageinfo
+*/
+void KIPI::ImageInfo::cloneData( const ImageInfo& other )
+{
+ _data->cloneData( other._data );
+}
+
diff --git a/libkipi/libkipi/imageinfo.h b/libkipi/libkipi/imageinfo.h
new file mode 100644
index 0000000..f9b98f2
--- /dev/null
+++ b/libkipi/libkipi/imageinfo.h
@@ -0,0 +1,82 @@
+/* ============================================================
+ * File : imageinfo.h
+ * Author: KIPI team developers (see AUTHORS files for details)
+ * Date : 2004-07-22
+ * Description :
+ *
+ * Copyright 2004 by the KIPI team
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Library General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * ============================================================ */
+
+/** @file imageinfo.h */
+
+#ifndef KIPI_IMAGEINFO_H
+#define KIPI_IMAGEINFO_H
+#include <kurl.h>
+#include <qstring.h>
+#include <qdatetime.h>
+#include <qmap.h>
+#include <qvariant.h>
+#include "libkipi/libkipi_export.h"
+
+namespace KIPI
+{
+ class ImageInfoShared;
+ enum TimeSpec { FromInfo, ToInfo };
+
+ /** @class ImageInfo
+ Holds info about an image
+ */
+ class LIBKIPI_EXPORT ImageInfo
+ {
+ public:
+ QString title() const;
+ void setTitle( const QString& name );
+
+ QString description() const;
+ void setDescription( const QString& description);
+
+ QMap<QString,QVariant> attributes() const;
+ void clearAttributes();
+ void addAttributes( const QMap<QString,QVariant>& );
+
+ KURL path() const;
+ QDateTime time( TimeSpec spec = FromInfo ) const;
+ void setTime( const QDateTime& time, TimeSpec spec = FromInfo );
+ bool isTimeExact() const;
+ int size() const;
+
+ int angle() const;
+ void setAngle( int );
+
+ QString toString( const QVariant& ) const;
+
+ void cloneData( const ImageInfo& other );
+
+ /** constructor
+ Interface for host application + general stuff
+ */
+ ImageInfo( ImageInfoShared* );
+ ImageInfo( const ImageInfo& );
+ ~ImageInfo();
+
+ private:
+ ImageInfo() {} // Disabled
+ ImageInfo& operator=( const ImageInfo& ) { return *this; } // Disabled
+ mutable KIPI::ImageInfoShared* _data;
+ };
+}
+
+#endif /* KIPI_IMAGEINFO_H */
+
diff --git a/libkipi/libkipi/imageinfoshared.cpp b/libkipi/libkipi/imageinfoshared.cpp
new file mode 100644
index 0000000..f206e3b
--- /dev/null
+++ b/libkipi/libkipi/imageinfoshared.cpp
@@ -0,0 +1,120 @@
+/* ============================================================
+ * File : imageinfoshared.cpp
+ * Authors: Jesper K. Pedersen <blackie@kde.org>
+ *
+ * Date : 2004-02-19
+ * Description :
+ *
+ * Copyright 2004 by Jesper K. Pedersen
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Library General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * ============================================================ */
+
+// Qt includes.
+
+#include <qfileinfo.h>
+
+// KDE includes.
+
+#include <kdebug.h>
+
+// Local includes.
+
+#include "imageinfoshared.h"
+#include "interface.h"
+
+KIPI::ImageInfoShared::ImageInfoShared( Interface* interface, const KURL& url )
+ : _url( url ), _count(1), _interface( interface )
+{
+}
+
+KURL KIPI::ImageInfoShared::path()
+{
+ return _url;
+}
+
+int KIPI::ImageInfoShared::size()
+{
+ if ( ! _url.isLocalFile() ) {
+ kdFatal() << "KIPI::ImageInfoShared::size does not yet support non local files, please fix\n";
+ return 0;
+ }
+ else
+ return QFileInfo( _url.path() ).size();
+}
+
+QDateTime KIPI::ImageInfoShared::time( KIPI::TimeSpec )
+{
+ if ( ! _url.isLocalFile() ) {
+ kdFatal() << "KIPI::ImageInfoShared::time does not yet support non local files, please fix\n";
+ return QDateTime();
+ }
+ else
+ return QFileInfo( _url.path() ).lastModified();
+}
+
+void KIPI::ImageInfoShared::addRef()
+{
+ _count++;
+}
+
+void KIPI::ImageInfoShared::removeRef()
+{
+ _count--;
+ if ( _count == 0 ) {
+ delete this;
+ }
+}
+
+int KIPI::ImageInfoShared::angle()
+{
+ return 0;
+}
+
+void KIPI::ImageInfoShared::setAngle( int )
+{
+}
+
+bool KIPI::ImageInfoShared::isTimeExact()
+{
+ return true;
+}
+
+void KIPI::ImageInfoShared::setTime( const QDateTime& /*time*/, TimeSpec /*spec*/ )
+{
+}
+
+void KIPI::ImageInfoShared::setTitle( const QString& )
+{
+ kdWarning(51000) << "This method should only be invoked if the host application supports the KIPI::ImageTitlesWritable\n"
+ "If the host application do support that, then this function should\n"
+ "have been overriden in the host application.\n";
+}
+
+void KIPI::ImageInfoShared::cloneData( ImageInfoShared* other )
+{
+ if ( _interface->hasFeature( ImageTitlesWritable ) )
+ setTitle( other->title() );
+
+ if ( _interface->hasFeature( ImagesHasComments ) )
+ setDescription( other->description() );
+
+ clearAttributes();
+ addAttributes( other->attributes() );
+
+ setTime( other->time( FromInfo ), FromInfo );
+ if ( _interface->hasFeature( SupportsDateRanges ) )
+ setTime( other->time( ToInfo ), ToInfo );
+
+ setAngle( other->angle() );
+}
diff --git a/libkipi/libkipi/imageinfoshared.h b/libkipi/libkipi/imageinfoshared.h
new file mode 100644
index 0000000..afdbc1d
--- /dev/null
+++ b/libkipi/libkipi/imageinfoshared.h
@@ -0,0 +1,91 @@
+/* ============================================================
+ * File : imageinfoshared.h
+ * Authors: Jesper K. Pedersen <blackie@kde.org>
+ *
+ * Date : 2004-02-19
+ * Description :
+ *
+ * Copyright 2004 by Jesper K. Pedersen
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Library General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * ============================================================ */
+
+#ifndef KIPI_IMAGEINFOSHARED_H
+#define KIPI_IMAGEINFOSHARED_H
+
+// Qt includes.
+
+#include <qstring.h>
+#include <qmap.h>
+#include <qdatetime.h>
+#include <qvariant.h>
+
+// KDE includes.
+
+#include <kurl.h>
+
+// LibKIPI includes.
+
+#include "libkipi/imageinfo.h"
+#include "libkipi/libkipi_export.h"
+
+namespace KIPI
+{
+ class Interface;
+
+ class LIBKIPI_EXPORT ImageInfoShared
+ {
+ public:
+ ImageInfoShared( KIPI::Interface* interface, const KURL& url );
+ virtual ~ImageInfoShared() {}
+ virtual QString title() {return QString::null;}
+ virtual void setTitle( const QString& );
+
+ virtual QString description() = 0;
+ virtual void setDescription( const QString& ) = 0;
+
+ virtual QMap<QString,QVariant> attributes() = 0;
+ virtual void clearAttributes() = 0;
+ virtual void addAttributes( const QMap<QString,QVariant>& ) = 0;
+
+ virtual KURL path();
+ virtual QDateTime time( KIPI::TimeSpec spec );
+ virtual void setTime( const QDateTime& time, TimeSpec spec = FromInfo );
+
+ virtual bool isTimeExact();
+
+ virtual int size();
+
+ virtual int angle();
+ virtual void setAngle( int );
+
+ QString toString( const QVariant& );
+
+ virtual void cloneData( ImageInfoShared* other );
+
+ protected:
+ KURL _url;
+
+ private:
+ ImageInfoShared() {} // Disable
+
+ friend class ImageInfo;
+ void addRef();
+ void removeRef();
+ int _count;
+ Interface* _interface;
+ };
+}
+
+#endif /* IMAGEINFOSHARED_H */
+
diff --git a/libkipi/libkipi/interface.cpp b/libkipi/libkipi/interface.cpp
new file mode 100644
index 0000000..8adc3b0
--- /dev/null
+++ b/libkipi/libkipi/interface.cpp
@@ -0,0 +1,221 @@
+/* ============================================================
+ * File : interface.cpp
+ * Authors: KIPI team developers (see AUTHORS files for details)
+ *
+ * Date : 2004-02
+ * Description :
+ *
+ * Copyright 2004 by the KIPI team
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Library General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * ============================================================ */
+
+/** @file interface.cpp */
+
+// KDE includes.
+
+#include <kdebug.h>
+#include <kimageio.h>
+
+// Local includes.
+
+#include "pluginloader.h"
+#include "interface.h"
+
+/*!
+ @enum KIPI::Features
+ Not all host applications support the full subset of features that KIPI
+ allows access to. As an example <a
+ href="http://ktown.kde.org/kimdaba/">KimDaBa</a> do not support comments
+ for albums. Thus before a plugin expect a decant value for the comment,
+ it should check whether KIPI::AlbumsHaveComments are set. It does so
+ using KIPI::Interface::hasFeature()
+ When adding new items, remember to update "hasFeature( const QString& feature )"
+ and the hello world plugin.
+ */
+
+/*!
+ \enum KIPI::AlbumsHaveComments
+ This feature specify that albums have descriptions associated to them.
+ */
+
+/*!
+ \enum KIPI::ImagesHasComments
+ This feature specifies that images in the host application has descriptions associated to them.
+ */
+
+/*!
+ \enum KIPI::ImagesHasTime
+ This feature specifies that images has a date associated with it, which the host application can display and set
+*/
+
+/*!
+ \enum KIPI::SupportsDateRanges
+ This feature specify whether the host application supports that the user can specify a date range for images,
+ like 1998-2000.
+*/
+
+/*!
+ \enum KIPI::AcceptNewImages
+ This feature specifies that the host application do accept new images.
+ Use \ref ImageCollection::uploadPath to find the location to place the image, and
+ \ref KIPI::Interface::addImage() to tell the host application about the new image.
+*/
+
+/*!
+ \enum KIPI::ImageTitlesWritable
+ This features specifies whether the plugin can change the title for images
+*/
+
+/*!
+ \enum KIPI::AlbumsHaveCategory
+ This feature specify that albums are category associated to them ('travels', 'friends', 'monuments', etc.).
+*/
+
+/*!
+ \enum KIPI::AlbumsHaveCreationDate
+ This feature specify that albums are a creation date associated to them.
+*/
+
+/*!
+ \enum KIPI::AlbumsUseFirstImagePreview
+ This feature specify that albums use the first image of the collection like preview.
+ This flag is used in ImageGallery, CDArchiving, and FinDuplicateImages dialog for
+ to lauch a preview of the album.
+*/
+
+
+KIPI::Interface::Interface(QObject *parent, const char *name )
+ : QObject(parent, name)
+{
+}
+
+KIPI::Interface::~Interface()
+{
+}
+
+/**
+ Tells the host app that the following images has changed on disk
+*/
+void KIPI::Interface::refreshImages( const KURL::List& )
+{
+}
+
+/**
+ Tells whether the host application under which the plugin currently executes a given feature.
+ See KIPI::Features for details on the individual features.
+*/
+bool KIPI::Interface::hasFeature( KIPI::Features feature )
+{
+ return ( features() & feature ) != 0;
+}
+
+bool KIPI::Interface::hasFeature( const QString& feature )
+{
+ if ( feature == "AlbumsHaveComments" )
+ return hasFeature( KIPI::AlbumsHaveComments );
+ else if ( feature == "ImagesHasComments" )
+ return hasFeature( KIPI::ImagesHasComments );
+ else if ( feature == "ImagesHasTime" )
+ return hasFeature( KIPI::ImagesHasTime );
+ else if ( feature == "SupportsDateRanges" )
+ return hasFeature( KIPI::SupportsDateRanges );
+ else if ( feature == "AcceptNewImages" )
+ return hasFeature( KIPI::AcceptNewImages );
+ else if ( feature == "ImageTitlesWritable" )
+ return hasFeature( KIPI::ImageTitlesWritable );
+ else if ( feature == "AlbumsHaveCategory" )
+ return hasFeature( KIPI::AlbumsHaveCategory );
+ else if ( feature == "AlbumsHaveCreationDate" )
+ return hasFeature( KIPI::AlbumsHaveCreationDate );
+ else if ( feature == "AlbumsUseFirstImagePreview" )
+ return hasFeature( KIPI::AlbumsUseFirstImagePreview );
+ else if ( feature == "HostSupportsTags" )
+ return hasFeature( KIPI::HostSupportsTags );
+ else {
+ kdWarning( 51000 ) << "Unknown feature asked for in KIPI::Interface::hasFeature: " << feature << endl;
+ return false;
+ }
+}
+
+/*!
+ Tell the host application that a new image has been made available to it.
+ Returns true if the host application did accept the new image, otherwise err will be filled with
+ an error description.
+*/
+bool KIPI::Interface::addImage( const KURL&, QString& /*err*/ )
+{
+ kdWarning(51000) << "Interface::addImage should only be invoked if the host application supports the KIPI::Features\n"
+ "AcceptNewImages - if the host application do support that, then this function should\n"
+ "have been overriden in the host application.\n";
+ return false;
+}
+
+void KIPI::Interface::delImage( const KURL& )
+{
+}
+
+/**
+ Returns list of all images in current album.
+ If there are no current album, the returned
+ KIPI::ImageCollection::isValid() will return false.
+*/
+KIPI::ImageCollection KIPI::Interface::currentAlbum()
+{
+ // This implementation is just to be able to write documentation above.
+ return KIPI::ImageCollection();
+}
+
+/**
+ Current selection in a thumbnail view for example.
+ If there are no current selection, the returned
+ KIPI::ImageCollection::isValid() will return false.
+*/
+KIPI::ImageCollection KIPI::Interface::currentSelection()
+{
+ // This implementation is just to be able to write documentation above.
+ return KIPI::ImageCollection();
+}
+
+/**
+ Returns a list of albums.
+*/
+QValueList<KIPI::ImageCollection> KIPI::Interface::allAlbums()
+{
+ // This implementation is just to be able to write documentation above.
+ return QValueList<KIPI::ImageCollection>();
+}
+
+
+/**
+ Return a bitwise or of the KIPI::Features that thus application support.
+*/
+int KIPI::Interface::features() const
+{
+ // This implementation is just to be able to write documentation above.
+ return 0;
+}
+
+/**
+ Return a list of images file extention will be used in the plugins for
+ to sort the files list before a treatment. The default implementation return,
+ the supported images formats by KDE.
+*/
+QString KIPI::Interface::fileExtensions()
+{
+ QStringList KDEImagetypes = KImageIO::mimeTypes( KImageIO::Reading );
+ QString imagesFileFilter = KDEImagetypes.join(" ");
+ return ( imagesFileFilter.lower() + " " + imagesFileFilter.upper() );
+}
+
+#include "interface.moc"
diff --git a/libkipi/libkipi/interface.h b/libkipi/libkipi/interface.h
new file mode 100644
index 0000000..dfccf08
--- /dev/null
+++ b/libkipi/libkipi/interface.h
@@ -0,0 +1,94 @@
+/* ============================================================
+ * File : interface.h
+ * Authors: KIPI team developers (see AUTHORS files for details)
+ *
+ * Date : 2004-02
+ * Description :
+ *
+ * Copyright 2004 by the KIPI team
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Library General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * ============================================================ */
+
+/** @file interface.h */
+#ifndef KIPI_INTERFACE_H
+#define KIPI_INTERFACE_H
+
+// Qt includes.
+
+#include <qstring.h>
+#include <qobject.h>
+
+// KDE includes.
+
+#include <kurl.h>
+
+// Local includes.
+
+#include "libkipi/imagecollection.h"
+#include "libkipi/imageinfo.h"
+#include "libkipi/libkipi_export.h"
+
+/** @namespace KIPI */
+namespace KIPI
+{
+ enum Features {
+ AlbumsHaveComments = 1 << 0,
+ ImagesHasComments = 1 << 1,
+ ImagesHasTime = 1 << 2,
+ SupportsDateRanges = 1 << 3,
+ AcceptNewImages = 1 << 4,
+ ImageTitlesWritable = 1 << 5,
+ AlbumsHaveCategory = 1 << 6,
+ AlbumsHaveCreationDate = 1 << 7,
+ AlbumsUseFirstImagePreview = 1 << 8,
+ HostSupportsTags = 1 << 9
+ };
+
+ /** class Interface */
+ class LIBKIPI_EXPORT Interface : public QObject
+ {
+ Q_OBJECT
+
+ public:
+ Interface(QObject *parent, const char *name=0);
+ virtual ~Interface();
+
+ virtual ImageCollection currentAlbum() = 0;
+ virtual ImageCollection currentSelection() = 0;
+ virtual QValueList<ImageCollection> allAlbums() = 0;
+
+ virtual ImageInfo info( const KURL& ) = 0;
+ virtual bool addImage( const KURL&, QString& err );
+ virtual void delImage( const KURL& );
+
+ virtual void refreshImages( const KURL::List& );
+
+ virtual QString fileExtensions();
+
+ bool hasFeature( KIPI::Features feature );
+
+ protected:
+ virtual int features() const = 0;
+
+ private:
+ friend class PluginLoader;
+ bool hasFeature( const QString& feature );
+
+ signals:
+ void selectionChanged( bool hasSelection );
+ void currentAlbumChanged( bool anyAlbum );
+ };
+}
+
+#endif /* KIPI_INTERFACE_H */
diff --git a/libkipi/libkipi/kipi-plugins_logo.png b/libkipi/libkipi/kipi-plugins_logo.png
new file mode 100644
index 0000000..8847b30
--- /dev/null
+++ b/libkipi/libkipi/kipi-plugins_logo.png
Binary files differ
diff --git a/libkipi/libkipi/kipiplugin.desktop b/libkipi/libkipi/kipiplugin.desktop
new file mode 100644
index 0000000..b5be232
--- /dev/null
+++ b/libkipi/libkipi/kipiplugin.desktop
@@ -0,0 +1,67 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=ServiceType
+X-KDE-ServiceType=KIPI/Plugin
+X-KDE-DerivedName=KIPI Plugin
+Name=KIPIPlugin
+Name[br]=Lugent KIPIP
+Name[cs]=KIPI modul
+Name[da]=KIPI-plugin
+Name[es]=Extensión de KIPI
+Name[et]=KIPI plugin
+Name[fi]=KIPILiitännäinen
+Name[gl]=Plugin de KIPI
+Name[it]=PluginDiKIPI
+Name[nb]=KIPI programtillegg
+Name[nl]=KIPI-plugin
+Name[pl]=Wtyczka KIPI
+Name[pt]='Plugin' do KIPI
+Name[pt_BR]='Plugin' do KIPI
+Name[sk]=KIPI modul
+Name[sr]=KIPI прикључак
+Name[sr@Latn]=KIPI priključak
+Name[sv]=KIPI-insticksprogram
+Name[tg]=МодулиKIPI
+Name[tr]=KIPIEklentisi
+Name[xx]=xxKIPIPluginxx
+Name[zh_CN]=KIPI 插件
+Comment=A KIPI Plugin
+Comment[ar]=قابس KIPI
+Comment[bg]=Приставка за KIPI
+Comment[br]=Ul lugent KIPI
+Comment[cs]=KIPI modul
+Comment[da]=Et KIPI-plugin
+Comment[de]=Ein KIPI-Plugin
+Comment[el]=Ένα πρόσθετο του KIPI
+Comment[es]=Una extensión para KIPI
+Comment[et]=KIPI plugin
+Comment[fi]=Kipi-liitännäinen
+Comment[fr]=Un module externe KIPI
+Comment[ga]=Breiseán KIPI
+Comment[gl]=Un plugin de KIPI
+Comment[it]=Un plugin di KIPI
+Comment[ja]=Kipi プラグイン
+Comment[ka]=KIPI-ს მოდული
+Comment[lt]=KIPI priedas
+Comment[nb]=Et KIPI programtillegg
+Comment[nl]=Een KIPI-plugin
+Comment[pa]=ਇੱਕ KIPI ਪਲੱਗਿੰਨ
+Comment[pl]=Wtyczka KIPI
+Comment[pt]=Um 'Plugin' do KIPI
+Comment[pt_BR]=Um 'Plugin' do KIPI
+Comment[sk]=KIPI modul
+Comment[sr]=KIPI прикључак
+Comment[sr@Latn]=KIPI priključak
+Comment[sv]=Ett KIPI-insticksprogram
+Comment[tg]=Модули KIPI
+Comment[tr]=Bir KIPI Eklentisi
+Comment[uk]=Втулок KIPI
+Comment[xx]=xxA KIPI Pluginxx
+Comment[zh_CN]=一个 KIPI 插件
+
+[PropertyDef::X-KIPI-Id]
+Type=QString
+
+[PropertyDef::X-KIPI-ReqFeatures]
+Type=QStringList
+
diff --git a/libkipi/libkipi/libkipi_export.h.in b/libkipi/libkipi/libkipi_export.h.in
new file mode 100644
index 0000000..028e111
--- /dev/null
+++ b/libkipi/libkipi/libkipi_export.h.in
@@ -0,0 +1,37 @@
+/*
+ This file is part of libkipi project
+ Copyright (c) 2005 Laurent Montel <montel@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _LIBKIPI_EXPORT_H
+#define _LIBKIPI_EXPORT_H
+
+#undef KDEMACROS_USABLE
+
+#ifdef KDEMACROS_USABLE
+#include <kdemacros.h>
+#endif
+
+#ifdef KDE_EXPORT
+#define LIBKIPI_EXPORT KDE_EXPORT
+#else
+#define LIBKIPI_EXPORT
+#endif
+
+#endif /* _LIBKIPI_EXPORT_H */
+
diff --git a/libkipi/libkipi/mainpage.cpp b/libkipi/libkipi/mainpage.cpp
new file mode 100644
index 0000000..0347fc7
--- /dev/null
+++ b/libkipi/libkipi/mainpage.cpp
@@ -0,0 +1,100 @@
+/**
+ \mainpage libkipi reference page.
+
+ This page will tell you both how to develop a new
+ plugin for KIPI, and how to add KIPI support to a new
+ application (referred to as host application).
+
+ You can find more information about KIPI at this <a
+ href="http://extragear.kde.org/apps/kipi">url</a>.
+
+ This documentation has been writen by Renchi Raju, Gilles Caulier,
+ Jesper K. Pedersen, and Aurelien Gateau.
+
+ <h1>Developing a new Plugin</h1>
+ The easiest way to start a new plugin, is to copy the hello world
+ plugin, which you may find in kdeextragear-libs-1/kipi-plugins. Please
+ also read <a
+ href="http://developer.kde.org/documentation/tutorials/developing-a-plugin-structure/index.html">
+ this tutorial</a> which tells in general about developing a plugin
+ structure for an application, but it also gives some background
+ information on how plugins are loaded, and especially on the macros
+ involved. The tutorial has been written by one of the KIPI authors, so
+ it matches fairly good the model of KIPI (except the part on merging
+ GUI's from plugins).
+
+
+
+
+ <h2>General things to do to implement a plugin</h2>
+ Here is a list of things to do.
+ <ul>
+ <li> Create a class that inherits KIPI::Plugin. In the constructor you
+ must create instances of KAction for your application. The topmost
+ actions should be given to the Plugin super class using
+ KIPI::Plugin::addAction().
+ <li> As described in the tutorial <a href="http://developer.kde.org/documentation/tutorials/developing-a-plugin-structure/index.html#understanding_loading">here</a>, you must call the macro
+ <tt>K_EXPORT_COMPONENT_FACTORY</tt>.
+ <li> You also need to create a desktop file, as described <a href="http://developer.kde.org/documentation/tutorials/developing-a-plugin-structure/index.html#makefile_am_client">here</a>
+ </ul>
+
+
+
+
+
+ <h2>Retrieving information from the host application</h2>
+ The above was the required step to build the plugin. The following will
+ tell you about the functions with which you communicate with the host
+ application.
+
+ The origin of all your communication with the host application is
+ \ref KIPI::Interface. You obtain a pointer to this by casting the parent
+ pointer given to your plugin during construction.
+
+ Selection of images can be obtained using
+ KIPI::Interface::currentSelection(), KIPI::Interface::currentAlbum() and
+ KIPI::Interface::allAlbums(). These methods uses KIPI::ImageCollection
+ to wrap a selection of images.
+
+ Finally to obtain information about individual images, call
+ KIPI::Interface::info(), which returns a KIPI::ImageInfo, with the
+ information.
+
+ When developing plugins, you should pay special attention to the fact the different
+ host applications may have different feature sets they
+ support. Information about what the host application support can be
+ obtained from KIPI::Interface::hasFeature().
+
+
+
+
+ <h2>Utilities for Plugins</h2>
+ KIPI has a number of utilities useful when developing plugins:
+ <ul>
+ <li> use KIPI::ImageCollectionDialog to ask the user for an image.
+ <li> use KIPI::UploadWidget when the user should specify a directory to
+ write images into.
+ <li> KIPI::ThumbnailJob helps you load thumb nails of images.
+ </ul>
+
+
+
+
+ <h1>Adding KIPI support to a new host application.</h1>
+ To add KIPI support to your application you must inherit
+ KIPI::Interface, and give an instance of this class to
+ KIPI::PluginLoader. See \ref KIPI::PluginLoader for details on loading plugins.
+
+ To be able to create an instance of your subclass of KIPI::Interface,
+ you must of course implement all the pure virtual method of the super
+ class, among others this requires you to create and return instances of
+ KIPI::ImageCollection and KIPI::ImageInfo. The only way you can do so
+ are by giving the classes a pointer to a subclass of
+ KIPI::ImageCollectionShared and KIPI::ImageInfoShared. These sub classes
+ are also your responsibility to implement.
+
+ The reason why things are that complicated, are to solve the problem of
+ ownership of pointers to the classes in question. The
+ KIPI::ImageCollectionShared pointer you give to KIPI::ImageCollection
+ constructor will be the owned by the ImageCollection instance.
+*/
diff --git a/libkipi/libkipi/plugin.cpp b/libkipi/libkipi/plugin.cpp
new file mode 100644
index 0000000..920a31e
--- /dev/null
+++ b/libkipi/libkipi/plugin.cpp
@@ -0,0 +1,91 @@
+/* ============================================================
+ * File : plugin.cpp
+ * Authors: KIPI team developers (see AUTHORS files for details)
+ *
+ * Date : 2004-02
+ * Description :
+ *
+ * Copyright 2004 by the KIPI team
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Library General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * ============================================================ */
+
+// Qt includes.
+
+#include <qwidget.h>
+
+// KDE includes.
+
+#include <kaction.h>
+#include <kinstance.h>
+#include <kdebug.h>
+
+// Local includes.
+
+#include "plugin.h"
+
+
+struct KIPI::Plugin::Private {
+ QMap<QWidget*, KActionCollection*> m_actionCollection;
+ KInstance* m_instance;
+ QMap<QWidget*, KActionPtrList> m_actions;
+ QWidget* m_defaultWidget;
+};
+
+
+KIPI::Plugin::Plugin( KInstance* instance, QObject *parent, const char* name)
+ : QObject( parent, name)
+{
+ d=new Private;
+ d->m_instance=instance;
+}
+
+KIPI::Plugin::~Plugin()
+{
+ delete d;
+}
+
+KActionCollection* KIPI::Plugin::actionCollection( QWidget* widget )
+{
+ if ( widget == 0 )
+ widget = d->m_defaultWidget;
+
+ if (!d->m_actionCollection.contains( widget ))
+ kdWarning( 51000 ) << "Error in the plugin. The plugin needs to call Plugin::setup( QWidget* ) "
+ << "as the very first line when overriding the setup method." << endl;
+ return d->m_actionCollection[widget];
+}
+
+void KIPI::Plugin::addAction( KAction* action )
+{
+ d->m_actions[d->m_defaultWidget].append( action );
+}
+
+KActionPtrList KIPI::Plugin::actions( QWidget* widget )
+{
+ if ( widget == 0 )
+ widget = d->m_defaultWidget;
+
+ return d->m_actions[widget];
+}
+
+void KIPI::Plugin::setup( QWidget* widget )
+{
+ d->m_defaultWidget = widget;
+ d->m_actions.insert( widget, KActionPtrList() );
+ QString name = QString( "action collection for %1" ).arg( widget->name() );
+ d->m_actionCollection.insert( widget, new KActionCollection( widget, widget, name.latin1(), d->m_instance ) );
+}
+
+
+
diff --git a/libkipi/libkipi/plugin.h b/libkipi/libkipi/plugin.h
new file mode 100644
index 0000000..f55942c
--- /dev/null
+++ b/libkipi/libkipi/plugin.h
@@ -0,0 +1,76 @@
+/* ============================================================
+ * File : plugin.h
+ * Authors: KIPI team developers (see AUTHORS files for details)
+ *
+ * Date : 2004-02
+ * Description :
+ *
+ * Copyright 2004 by the KIPI team
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Library General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * ============================================================ */
+
+#ifndef KIPI_PLUGIN_H
+#define KIPI_PLUGIN_H
+
+// Qt includes.
+
+#include <qobject.h>
+
+// KDE includes.
+
+#include <kaction.h>
+
+// Lib KIPI includes.
+
+#include "libkipi/interface.h"
+
+#include "libkipi/libkipi_export.h"
+
+class KInstance;
+
+/** @namespace KIPI */
+namespace KIPI
+{
+ enum Category
+ {
+ IMAGESPLUGIN = 0,
+ EFFECTSPLUGIN,
+ TOOLSPLUGIN,
+ IMPORTPLUGIN,
+ EXPORTPLUGIN,
+ BATCHPLUGIN,
+ COLLECTIONSPLUGIN
+ };
+
+ class LIBKIPI_EXPORT Plugin : public QObject
+ {
+ public:
+ Plugin( KInstance* instance, QObject *parent, const char* name);
+ virtual ~Plugin();
+
+ virtual void setup( QWidget* widget ) = 0;
+ KActionPtrList actions( QWidget* parent = 0 );
+ KActionCollection* actionCollection( QWidget* parent = 0 );
+ virtual Category category( KAction* action ) const = 0;
+
+ protected:
+ void addAction( KAction* action );
+
+ private:
+ struct Private;
+ Private* d;
+ };
+}
+
+#endif // KIPI_PLUGIN_H
diff --git a/libkipi/libkipi/pluginloader.cpp b/libkipi/libkipi/pluginloader.cpp
new file mode 100644
index 0000000..f7f8aa5
--- /dev/null
+++ b/libkipi/libkipi/pluginloader.cpp
@@ -0,0 +1,388 @@
+/* ============================================================
+ * File : pluginloader.cpp
+ * Author: Renchi Raju <renchi@pooh.tam.uiuc.edu>
+ * Date : 2004-02-19
+ * Description :
+ *
+ * Copyright 2004 by Renchi Raju
+
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Library General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * ============================================================ */
+
+/** @file pluginloader.cpp */
+
+#include <qstringlist.h>
+
+#include <ktrader.h>
+#include <kparts/componentfactory.h>
+#include <kdebug.h>
+#include <kdialog.h>
+
+#include "plugin.h"
+#include "pluginloader.h"
+#include "interface.h"
+#include <kconfig.h>
+#include <qcheckbox.h>
+#include <qlayout.h>
+
+/**
+ \author Renchi Raju
+ \class KIPI::PluginLoader
+ This is the class that will help host applications to load plugins.
+
+ The host application must create an instance of the plugin loader, and
+ call the method loadPlugins() to get the plugins loaded. To ensure that
+ plugins are correctly removed from menus and toolbars when loaded and
+ unloaded after constructions, the application must connect to either the
+ signals plug() / unplug() or the signal replug(). These signals are
+ emitted when a plugin is to be inserted into the menus.
+
+ If your application is using XMLGUI, the easiest way to get the plugins
+ inserted into the menus is by adding an item in the ui.rc file looking
+ list this:
+ &lt;ActionList name="image_actions"/&gt;
+
+ Then plugin plugins into menus could be done with code similiar to this from KimDaBa:
+ \code
+ void slotReplug() {
+ unplugActionList( QString::fromLatin1("file_actions") );
+ unplugActionList( QString::fromLatin1("image_actions") );
+ unplugActionList( QString::fromLatin1("tool_actions") );
+
+ QPtrList<KAction> fileActions;
+ QPtrList<KAction> imageActions;
+ QPtrList<KAction> toolsActions;
+
+ KIPI::PluginLoader::PluginList list = _pluginLoader->pluginList();
+ for( KIPI::PluginLoader::PluginList::Iterator it = list.begin(); it != list.end(); ++it ) {
+ KIPI::Plugin* plugin = (*it)->plugin;
+ if ( !plugin || !(*it)->shouldLoad )
+ continue;
+
+ plugin->setup( this );
+ QPtrList<KAction>* popup = 0;
+ if ( plugin->category() == KIPI::IMAGESPLUGIN )
+ popup = &imageActions;
+
+ else if ( plugin->category() == KIPI::EXPORTPLUGIN ||
+ plugin->category() == KIPI::IMPORTPLUGIN )
+ popup = &fileActions;
+
+ else if ( plugin->category() == KIPI::TOOLSPLUGIN )
+ popup = &toolsActions;
+
+ if ( popup ) {
+ KActionPtrList actions = plugin->actions();
+ for( KActionPtrList::Iterator it = actions.begin(); it != actions.end(); ++it ) {
+ popup->append( *it );
+ }
+ }
+ else {
+ kdDebug() << "No menu found\n";
+ }
+ plugin->actionCollection()->readShortcutSettings();
+ }
+
+ // For this to work I need to pass false as second arg for createGUI
+ plugActionList( QString::fromLatin1("file_actions"), fileActions );
+ plugActionList( QString::fromLatin1("image_actions"), imageActions );
+ plugActionList( QString::fromLatin1("tool_actions"), toolsActions );
+ }
+ \endcode
+
+ To configure which plugins should be loaded, simply call
+ PluginLoader::configWidget(), and insert the widget into your normal
+ configuration dialog.
+*/
+namespace KIPI {
+
+//---------------------------------------------------------------------
+//
+// PluginLoader::Info
+//
+//---------------------------------------------------------------------
+struct PluginLoader::Info::Private {
+ QString m_name;
+ QString m_comment;
+ QString m_library;
+ Plugin* m_plugin;
+ bool m_shouldLoad;
+};
+
+
+PluginLoader::Info::Info(const QString& name, const QString& comment, const QString& library, bool shouldLoad)
+{
+ d=new Private;
+ d->m_name=name;
+ d->m_comment=comment;
+ d->m_library=library;
+ d->m_plugin=0;
+ d->m_shouldLoad=shouldLoad;
+}
+
+
+PluginLoader::Info::~Info()
+{
+ delete d;
+}
+
+
+QString PluginLoader::Info::name() const
+{
+ return d->m_name;
+}
+
+
+QString PluginLoader::Info::comment() const
+{
+ return d->m_comment;
+}
+
+
+QString PluginLoader::Info::library() const
+{
+ return d->m_library;
+}
+
+
+Plugin* PluginLoader::Info::plugin() const
+{
+ return d->m_plugin;
+}
+
+
+void PluginLoader::Info::setPlugin(Plugin* plugin)
+{
+ d->m_plugin=plugin;
+}
+
+
+bool PluginLoader::Info::shouldLoad() const
+{
+ return d->m_shouldLoad;
+}
+
+
+void PluginLoader::Info::setShouldLoad(bool value)
+{
+ d->m_shouldLoad=value;
+}
+
+
+//---------------------------------------------------------------------
+//
+// PluginLoader
+//
+//---------------------------------------------------------------------
+static PluginLoader* s_instance = 0;
+
+
+struct PluginLoader::Private
+{
+ PluginList m_pluginList;
+ Interface* m_interface;
+ QStringList m_ignores;
+};
+
+
+PluginLoader::PluginLoader( const QStringList& ignores, Interface* interface )
+{
+ Q_ASSERT( s_instance == 0 );
+ s_instance = this;
+
+ d=new Private;
+ d->m_interface = interface;
+ d->m_ignores = ignores;
+
+ KTrader::OfferList offers = KTrader::self()->query("KIPI/Plugin");
+ KConfig* config = KGlobal::config();
+ config->setGroup( QString::fromLatin1( "KIPI/EnabledPlugin" ) );
+
+ KTrader::OfferList::ConstIterator iter;
+ for(iter = offers.begin(); iter != offers.end(); ++iter) {
+
+ KService::Ptr service = *iter;
+ QString name = service->name();
+ QString comment = service->comment();
+ QString library = service->library();
+ QStringList reqFeatures = service->property( QString::fromLatin1( "X-KIPI-ReqFeatures" ) ).toStringList();
+
+ if (library.isEmpty() || name.isEmpty() ) {
+ kdWarning( 51001 ) << "KIPI::PluginLoader: Plugin had an empty name or library file - this should not happen." << endl;
+ continue;
+ }
+
+ if ( d->m_ignores.contains( name ) ) {
+ kdDebug( 51001 ) << "KIPI::PluginLoader: plugin " << name << " is in the ignore list for host application" << endl;
+ continue;
+ }
+
+ bool appHasAllReqFeatures=true;
+ for( QStringList::Iterator featureIt = reqFeatures.begin(); featureIt != reqFeatures.end(); ++featureIt ) {
+ if ( !d->m_interface->hasFeature( *featureIt ) ) {
+ kdDebug( 51001 ) << "Plugin " << name << " was not loaded because the host application is missing\n"
+ << "the feature " << *featureIt << endl;
+ appHasAllReqFeatures=false;
+ break;
+ }
+ }
+
+ bool load = config->readBoolEntry( name, true );
+
+ if (!appHasAllReqFeatures)
+ continue;
+
+ Info* info = new Info( name, comment, library, load );
+ d->m_pluginList.append( info );
+ }
+}
+
+PluginLoader::~PluginLoader()
+{
+ delete d;
+}
+
+void PluginLoader::loadPlugins()
+{
+ for( PluginList::Iterator it = d->m_pluginList.begin(); it != d->m_pluginList.end(); ++it ) {
+ loadPlugin( *it );
+ }
+ emit replug();
+}
+
+void PluginLoader::loadPlugin( Info* info )
+{
+ if ( info->plugin() == 0 && info->shouldLoad() ) {
+ Plugin *plugin = 0;
+ int error;
+ plugin = KParts::ComponentFactory
+ ::createInstanceFromLibrary<Plugin>(info->library().local8Bit().data(),
+ d->m_interface, 0, QStringList(), &error);
+
+ if (plugin)
+ kdDebug( 51001 ) << "KIPI::PluginLoader: Loaded plugin " << plugin->name()<< endl;
+ else
+ {
+ kdWarning( 51001 ) << "KIPI::PluginLoader:: createInstanceFromLibrary returned 0 for "
+ << info->name()
+ << " (" << info->library() << ")"
+ << " with error number "
+ << error << endl;
+ if (error == KParts::ComponentFactory::ErrNoLibrary)
+ kdWarning( 51001 ) << "KLibLoader says: "
+ << KLibLoader::self()->lastErrorMessage() << endl;
+ }
+ info->setPlugin(plugin);
+ }
+ if ( info->plugin() ) // Do not emit if we had trouble loading the plugin.
+ emit PluginLoader::instance()->plug( info );
+}
+
+
+const PluginLoader::PluginList& PluginLoader::pluginList()
+{
+ return d->m_pluginList;
+}
+
+PluginLoader* PluginLoader::instance()
+{
+ Q_ASSERT( s_instance != 0);
+ return s_instance;
+}
+
+
+//---------------------------------------------------------------------
+//
+// ConfigWidget
+//
+//---------------------------------------------------------------------
+ConfigWidget* PluginLoader::configWidget( QWidget* parent )
+{
+ return new ConfigWidget( parent );
+}
+
+
+class PluginCheckBox :public QCheckBox
+{
+public:
+ PluginCheckBox( PluginLoader::Info* info, QWidget* parent )
+ : QCheckBox( info->comment(), parent ), info( info )
+ {
+ setChecked( info->shouldLoad() );
+ }
+ PluginLoader::Info* info;
+};
+
+
+struct ConfigWidget::Private
+{
+ QValueList< PluginCheckBox* > _boxes;
+};
+
+
+ConfigWidget::ConfigWidget( QWidget* parent )
+ :QScrollView( parent, "KIPI::PluginLoader::ConfigWidget" )
+{
+ d=new Private;
+ QWidget* top = new QWidget( viewport() );
+ addChild( top );
+ setResizePolicy( AutoOneFit );
+
+ QVBoxLayout* lay = new QVBoxLayout( top, KDialog::marginHint(), KDialog::spacingHint() );
+
+ PluginLoader::PluginList list = PluginLoader::instance()->d->m_pluginList;
+ for( PluginLoader::PluginList::Iterator it = list.begin(); it != list.end(); ++it ) {
+ PluginCheckBox* cb = new PluginCheckBox( *it, top );
+ lay->addWidget( cb );
+ d->_boxes.append( cb );
+ }
+
+ lay->addStretch(10);
+}
+
+
+ConfigWidget::~ConfigWidget()
+{
+ delete d;
+}
+
+
+void ConfigWidget::apply()
+{
+ KConfig* config = KGlobal::config();
+ config->setGroup( QString::fromLatin1( "KIPI/EnabledPlugin" ) );
+ bool changes = false;
+
+ for( QValueList<PluginCheckBox*>::Iterator it = d->_boxes.begin(); it != d->_boxes.end(); ++it ) {
+ bool orig = (*it)->info->shouldLoad();
+ bool load = (*it)->isChecked();
+ if ( orig != load ) {
+ changes = true;
+ config->writeEntry( (*it)->info->name(), load );
+ (*it)->info->setShouldLoad(load);
+ if ( load ) {
+ PluginLoader::instance()->loadPlugin( (*it)->info);
+ }
+ else {
+ if ( (*it)->info->plugin() ) // Do not emit if we had trouble loading plugin.
+ emit PluginLoader::instance()->unplug( (*it)->info);
+ }
+ }
+ }
+ emit PluginLoader::instance()->replug();
+}
+
+
+} // namespace
+
+#include "pluginloader.moc"
diff --git a/libkipi/libkipi/pluginloader.h b/libkipi/libkipi/pluginloader.h
new file mode 100644
index 0000000..28455ca
--- /dev/null
+++ b/libkipi/libkipi/pluginloader.h
@@ -0,0 +1,102 @@
+/* ============================================================
+ * File : pluginloader.h
+ * Author: Renchi Raju <renchi@pooh.tam.uiuc.edu>
+ * Date : 2004-02-19
+ * Description :
+ *
+ * Copyright 2004 by Renchi Raju
+
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Library General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * ============================================================ */
+
+#ifndef KIPI_PLUGINLOADER_H
+#define KIPI_PLUGINLOADER_H
+
+#include "libkipi/interface.h"
+#include "libkipi/libkipi_export.h"
+#include <qwidget.h>
+#include <qscrollview.h>
+
+
+namespace KIPI
+{
+ class Plugin;
+ class Interface;
+ class ConfigWidget;
+
+ class LIBKIPI_EXPORT PluginLoader :public QObject
+ {
+ Q_OBJECT
+ public:
+ class LIBKIPI_EXPORT Info
+ {
+ public:
+ Info( const QString& name, const QString& comment, const QString& library, bool shouldLoad );
+ ~Info();
+ QString name() const;
+
+ QString comment() const;
+
+ QString library() const;
+
+ Plugin* plugin() const;
+ void setPlugin(Plugin*);
+
+ bool shouldLoad() const;
+ void setShouldLoad(bool);
+
+ private:
+ struct Private;
+ Private* d;
+ };
+
+ PluginLoader( const QStringList& ignores, Interface* interface );
+ virtual ~PluginLoader();
+ void loadPlugins();
+ static PluginLoader* instance();
+ ConfigWidget* configWidget( QWidget* parent );
+
+ typedef QValueList<Info*> PluginList;
+
+ const PluginList& pluginList();
+
+ void loadPlugin( Info* );
+
+ signals:
+ void plug( KIPI::PluginLoader::Info* );
+ void unplug( KIPI::PluginLoader::Info* );
+ void replug();
+
+ private:
+ friend class ConfigWidget;
+ friend class PluginCheckBox;
+
+ struct Private;
+ Private* d;
+ };
+
+ class LIBKIPI_EXPORT ConfigWidget :public QScrollView
+ {
+ Q_OBJECT
+ public:
+ ConfigWidget( QWidget* parent );
+ ~ConfigWidget();
+ public slots:
+ void apply();
+ private:
+ struct Private;
+ Private* d;
+ };
+}
+
+#endif /* PLUGINLOADER_H */
diff --git a/libkipi/libkipi/uploadwidget.cpp b/libkipi/libkipi/uploadwidget.cpp
new file mode 100644
index 0000000..80e0a5c
--- /dev/null
+++ b/libkipi/libkipi/uploadwidget.cpp
@@ -0,0 +1,209 @@
+/* ============================================================
+ * File : uploadwidget.cpp
+ * Authors: KIPI team developers (see AUTHORS files for details)
+ *
+ * Date : 2004-02
+ * Description :
+ *
+ * Copyright 2004 by the KIPI team
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Library General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * ============================================================ */
+
+// Qt includes.
+
+#include <qlayout.h>
+#include <qheader.h>
+#include <qlistview.h>
+#include <qdir.h>
+
+// KDE includes
+
+#include <kdebug.h>
+#include <klocale.h>
+#include <kio/jobclasses.h>
+#include <kmessagebox.h>
+
+#include <kdeversion.h>
+#if KDE_VERSION >= 0x30200
+#include <kinputdialog.h>
+#else
+#include <klineeditdlg.h>
+#define KInputDialog KLineEditDlg
+#endif
+
+// Local includes.
+
+#include "uploadwidget.h"
+#include "libkipi/imagecollection.h"
+
+
+struct KIPI::UploadWidget::Private
+{
+ KFileTreeView* m_treeView;
+ KFileTreeBranch* m_branch;
+ QStringList m_pendingPath;
+};
+
+
+/*!
+ \class KIPI::UploadWidget
+ This widget is used to specify an upload directory for new images.
+*/
+
+KIPI::UploadWidget::UploadWidget( KIPI::Interface* interface, QWidget* parent, const char* name )
+ : QWidget( parent, name )
+{
+ d = new Private;
+
+ QVBoxLayout* layout = new QVBoxLayout( this, 0 );
+ d->m_treeView = new KFileTreeView( this );
+ d->m_treeView->setRootIsDecorated( true );
+ layout->addWidget( d->m_treeView );
+
+ // Fetch the current album, so we can start out there.
+ KIPI::ImageCollection album = interface->currentAlbum();
+
+ // If no current album selected, get the first album in the list.
+ if ( !album.isValid() || !album.isDirectory() )
+ album = interface->allAlbums().first();
+
+ d->m_branch = d->m_treeView->addBranch( QDir::cleanDirPath(album.uploadRoot().path()),
+ album.uploadRootName() );
+ d->m_treeView->setDirOnlyMode( d->m_branch, true );
+
+ d->m_treeView->addColumn( i18n("Folder" ) );
+
+ d->m_treeView->header()->setStretchEnabled( true, 0 );
+ d->m_treeView->header()->hide();
+
+ QString root = album.uploadRoot().path();
+ QString uploadPath = album.isDirectory() ? album.uploadPath().path() : root;
+
+ root = QDir::cleanDirPath(root);
+ uploadPath = QDir::cleanDirPath(uploadPath);
+
+ if ( !uploadPath.startsWith( root ) )
+ {
+ kdWarning(51000) << "Error in Host application: uploadPath() should start with uploadRoot()." << endl
+ << "uploadPath() = " << album.uploadPath().prettyURL() << endl
+ << "uploadRoot() = " << album.uploadRoot().prettyURL() << endl;
+ }
+ else
+ {
+ uploadPath = uploadPath.mid( root.length() );
+
+ d->m_pendingPath = QStringList::split( "/", uploadPath, false );
+
+ connect( d->m_branch, SIGNAL( populateFinished(KFileTreeViewItem *) ),
+ this, SLOT( slotPopulateFinished(KFileTreeViewItem *) ) );
+
+ d->m_branch->setOpen(true);
+ }
+
+ connect( d->m_treeView, SIGNAL( executed(QListViewItem *) ),
+ this, SLOT( slotFolderSelected(QListViewItem *) ) );
+}
+
+KIPI::UploadWidget::~UploadWidget()
+{
+ delete d;
+}
+
+KURL KIPI::UploadWidget::path() const
+{
+ return d->m_treeView->currentURL();
+}
+
+void KIPI::UploadWidget::load( )
+{
+ kdWarning() << "KIPI::UploadWidget::load(): This method is obsolete\n";
+}
+
+void KIPI::UploadWidget::slotPopulateFinished( KFileTreeViewItem * parentItem )
+{
+ if ( d->m_pendingPath.isEmpty() )
+ {
+ disconnect( d->m_branch, SIGNAL( populateFinished(KFileTreeViewItem *) ),
+ this, SLOT( slotPopulateFinished(KFileTreeViewItem *) ) );
+ return;
+ }
+
+ QString itemName = d->m_pendingPath.front();
+
+ d->m_pendingPath.pop_front();
+
+ QListViewItem * item;
+ for ( item = parentItem->firstChild(); item; item = item->nextSibling() )
+ {
+ if ( item->text(0) == itemName )
+ {
+ break;
+ }
+ }
+
+ if ( !item )
+ {
+ kdDebug( 51000 ) << "Unable to open " << itemName << endl;
+ }
+ else
+ {
+ item->setOpen( true );
+ d->m_treeView->setSelected( item, true );
+ d->m_treeView->ensureItemVisible ( item );
+
+ KFileTreeViewItem * ftvItem = static_cast<KFileTreeViewItem *>( item );
+ if ( ftvItem->alreadyListed() )
+ slotPopulateFinished( ftvItem );
+ }
+
+}
+
+void KIPI::UploadWidget::mkdir()
+{
+ if ( !path().isValid() )
+ {
+ KMessageBox::error( this, i18n("Please select a directory first.") );
+ return;
+ }
+
+ bool ok;
+ QString dir = KInputDialog::getText( i18n("Create Directory"),
+ i18n("<qt>Enter new directory name (to be created as subdir of %1):</qt>")
+ .arg(path().prettyURL()), "", &ok, this);
+
+ if (!ok) return;
+
+ KURL url = path();
+ url.addPath( dir );
+
+ KIO::SimpleJob* job = KIO::mkdir(url);
+
+ connect(job, SIGNAL(result(KIO::Job*)),
+ this, SLOT(slotAlbumCreated(KIO::Job*)));
+}
+
+void KIPI::UploadWidget::slotAlbumCreated(KIO::Job* job)
+{
+ int code = job->error();
+
+ if ( code )
+ job->showErrorDialog( this );
+}
+
+void KIPI::UploadWidget::slotFolderSelected(QListViewItem *)
+{
+ emit folderItemSelected(d->m_treeView->currentURL());
+}
+
+#include "uploadwidget.moc"
diff --git a/libkipi/libkipi/uploadwidget.h b/libkipi/libkipi/uploadwidget.h
new file mode 100644
index 0000000..3c8dacc
--- /dev/null
+++ b/libkipi/libkipi/uploadwidget.h
@@ -0,0 +1,75 @@
+/* ============================================================
+ * File : uploadwidget.h
+ * Authors: KIPI team developers (see AUTHORS files for details)
+ *
+ * Date : 2004-02-19
+ * Description :
+ *
+ * Copyright 2004 by the KIPI team
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Library General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * ============================================================ */
+
+
+#ifndef KIPI_UPLOADWIDGET_H
+#define KIPI_UPLOADWIDGET_H
+
+// Qt includes.
+
+#include <qwidget.h>
+
+// KDE includes.
+
+#include <kfiletreeview.h>
+#include <kurl.h>
+
+// LibKIPI includes.
+
+#include "libkipi/interface.h"
+#include "libkipi/libkipi_export.h"
+
+class QListViewItem;
+
+namespace KIPI
+{
+ class LIBKIPI_EXPORT UploadWidget :public QWidget
+ {
+ Q_OBJECT
+
+ public:
+ UploadWidget( KIPI::Interface* interface, QWidget* parent, const char* name = 0 );
+ ~UploadWidget();
+ KURL path() const;
+
+ public slots:
+ void mkdir();
+
+ signals :
+ void folderItemSelected(const KURL &url);
+
+ protected slots:
+ void load();
+ void slotAlbumCreated(KIO::Job* job);
+ void slotFolderSelected(QListViewItem *);
+
+ private slots:
+ void slotPopulateFinished(KFileTreeViewItem *);
+
+ private:
+ struct Private;
+ Private* d;
+ };
+}
+
+#endif /* KIPI_UPLOADWIDGET_H */
+
diff --git a/libkipi/libkipi/version.h b/libkipi/libkipi/version.h
new file mode 100644
index 0000000..0c23b5f
--- /dev/null
+++ b/libkipi/libkipi/version.h
@@ -0,0 +1,31 @@
+/* ============================================================
+ * File : version.h
+ * Authors: Gilles Caulier <caulier dot gilles at free.fr>
+ * Date : 2004-09-09
+ * Description : KIPI release ID header.
+ *
+ * Copyright 2004 by Gilles Caulier
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * ============================================================ */
+
+
+#ifndef KIPI_VERSION_H
+#define KIPI_VERSION_H
+
+static const char kipi_version[] = "0.1.5";
+
+#define KIPI_VERSION 0x000105
+
+#endif // KIPI_VERSION_H
+