diff --git a/KexiProducts.cmake b/KexiProducts.cmake index 60ed43726..a620191c5 100644 --- a/KexiProducts.cmake +++ b/KexiProducts.cmake @@ -1,216 +1,216 @@ ### DEFINITION OF PRODUCTS, FEATURES AND PRODUCTSETS #################################################### # When building Kexi a lot of different things are created and installed. To # describe them and their internal dependencies the concepts of "product", # "feature" and "product set" are used. # A "product" is the smallest functional unit which can be created in the build # and which is useful on its own when installed. Examples are e.g. libraries, # plugins or executables. Products have external and internal required # dependencies at build-time. Internal dependencies are noted in terms of other # products or features (see below) and could be e.g. other libraries to link # against or build tools needed to generate source files. # A product gets defined by setting an identifier, a descriptive fullname and # the needed internal build-time requirements. Any other product or feature # listed as requirement must have been defined before. # A "feature" is not a standalone product, but adds abilities to one or multiple # given products. One examples is e.g. scriptability. Features have external and # internal required dependencies at build-time. Internal dependencies are noted # in terms of other products or features and could be e.g. other libraries to # link against or build tools needed to generate source files. # A feature gets defined by setting an identifier, a descriptive fullname and # the needed internal build-time requirements. Any other product or feature # listed as requirement must have been defined before. # A "productset" is a selection of products and features which should be build # together. The products and features can be either essential or optional to the # set. If essential (REQUIRES), the whole productset will not be build if a # product or feature is missing another internal or external dependency. If # optional (OPTIONAL), the rest of the set will still be build in that case. # The products and features to include in a set can be listed directly or -# indirectly: they can be named explicitely, but also by including other +# indirectly: they can be named explicitly, but also by including other # productsets in a set, whose products and features will then be part of the # first set as well. # Products, features and productsets can be listed as dependencies in multiple # product sets. As with dependencies for products or features, they must have # been defined before. # Products, features and product sets are in the same namespace, so a given # identifier can be only used either for a product or for a feature or for a # product set. # The ids of products and features (but not sets) are used to generate cmake # variables SHOULD_BUILD_${ID}, which then are used to control what is build and # how. ############################################# #### Product definitions #### ############################################# # For defining new products see end of this file, "How to add another product?" # IDEA: also add headers/sdk for all the libs ("_DEVEL"?) # IDEA: note external deps for products, so they are only checked if needed # There can be required or optional external deps, required will also result # in automatic disabling of product building # TODO: some products have multiple optional requirements, but need at least one. # See APP_CONVERTER, FILEMANAGER_* # products calligra_define_product(KEXI_CORE_APP "Kexi core app" REQUIRES) calligra_define_product(KEXI_DESKTOP_APP "Kexi for desktop" REQUIRES KEXI_CORE_APP) calligra_define_product(KEXI_MOBILE_APP "Kexi for mobile" REQUIRES KEXI_CORE_APP) # more plugins calligra_define_product(PLUGIN_KEXI_SPREADSHEETMIGRATION "Import from ODS plugin for Kexi" UNPORTED REQUIRES KEXI_CORE_APP) ############################################# #### Product set definitions #### ############################################# # For defining new productsets see end of this file, # "How to add another productset?" # (products sets are defined in cmake/productsets/*.cmake files) # How to add another product? # =========================== # # 1. Define the product by a call of calligra_define_product, # e.g. # # calligra_define_product(MYPRODUCT "title of product") # # For the product id use a proper prefix (LIB_, PLUGIN_, FILTER_, APP_, PART_, # ...), whatever is appropriate. # # 2. Extend that call with a REQUIRES argument section, if the product has # hard internal build-time dependencies on other products or features. # Products/features that are listed as dependencies have to be defined before # (see also the API doc in cmake/modules/CalligraProductSetMacros.cmake) # E.g. # # calligra_define_product(MYPRODUCT "title of product" REQUIRES P1 P2) # # 3. Add a rule when to not build the product, in the section "Detect which # products/features can be compiled" of the toplevel CMakeLists.txt. Each # product should have their own boolean expression when to set the build flag # to FALSE, e.g. # # if (PLATFORMX OR NOT EXTERNAL_DEP_X_FOUND) # set(SHOULD_BUILD_MYPRODUCT FALSE) # endif () # # 4. Wrap everything belonging to the product with the build flag of the product. # Ideally this is done around subdirectory inclusions, results in easier code. # e.g. # # if (SHOULD_BUILD_MYPRODUCT) # add_subdirectory(myproduct) # endif () # # 5. Tag the product as STAGING, if it is not yet ready for release, but already # integrated in the master branch, e.g. # # calligra_define_product(MYPRODUCT "title of product" STAGING REQUIRES P1) # # 6. Add the product to all products, features and product sets which have this # product as REQUIRED or OPTIONAL dependency. # # # How to add another feature? # =========================== # # 1. Define the feature by a call of calligra_define_feature, # e.g. # # calligra_define_feature(MYFEATURE "title of feature") # # For the feature id use a proper prefix (FEATURE_, ...), whatever is # appropriate. # # 2. Extend that call with a REQUIRES argument section, if the feature has # hard internal build-time dependencies on other products or features. # Products or features that are listed as dependencies have to be defined # before # (see also the API doc in cmake/modules/CalligraProductSetMacros.cmake) # E.g. # # calligra_define_feature(MYFEATURE "title of feature" REQUIRES P1 F1) # # 3. Add a rule when to not build the feature, in the section "Detect which # products/features can be compiled" of the toplevel CMakeLists.txt. Each # feature should have their own boolean expression when to set the build flag # to FALSE, e.g. # # if (PLATFORMX OR NOT EXTERNAL_DEP_X_FOUND) # set(SHOULD_BUILD_MYFEATURE FALSE) # endif () # # 4. Wrap everything belonging to the feature with the build flag of the feature. # Ideally this is done around subdirectory inclusions, results in easier code. # e.g. # # if (SHOULD_BUILD_MYFEATURE) # add_subdirectory(myproduct) # endif () # # 5. Tag the feature as STAGING, if it is not yet ready for release, but already # integrated in the master branch, e.g. # # calligra_define_product(MYFEATURE "title of feature" STAGING REQUIRES P1 F1) # # 6. Add the feature to all products, features and product sets which have this # product as REQUIRED or OPTIONAL dependency. # # # How to add another productset? # ============================== # # There are two possible places to put a productset definition. The first is to # add it to this file, which should be done for more generic sets that are # useful for many people. The second is a file of its own, in the directory # "cmake/productsets", which should be done for more special ones or for those # which should not be added to the repository. # The file must be named with the name of the productset in lowercase and have # the extension ".cmake". # # 1. Define the productset by a call of calligra_define_productset, # e.g. # # calligra_define_productset(MYPRODUCTSET "title of productset") # # 2. Extend that call with REQUIRES or OPTIONAL argument sections, if the productset # has hard or soft internal dependencies on other products, features or # productsets. # Products, features or productsets that are listed as dependencies have to # be defined before # (see also the API doc in cmake/modules/CalligraProductSetMacros.cmake) # E.g. # # calligra_define_productset(MYPRODUCT "title of product" # REQUIRES P1 P2 F1 PS1 # OPTIONAL P3 F2 PS2) # # 3. Add the productset to all product sets which have this product set as # REQUIRED or OPTIONAL dependency. # # Example for a file-based productset definition: # You want a productset "MYWORDS". For that you add a file named # "mywords.cmake" into the directory "cmake/productsets", with the content: # --- 8< --- # calligra_define_productset(MYWORDS "My Words" # REQUIRES # APP_WORDS # PLUGIN_DEFAULTTOOLS # PLUGIN_DOCKERS # PLUGIN_PATHSHAPES # PLUGIN_VARIABLES # PLUGIN_TEXTSHAPE # PLUGIN_PLUGINSHAPE # PLUGIN_FORMULASHAPE # ) # --- 8< --- diff --git a/src/doc/dev/kexi_final_mode.txt b/src/doc/dev/kexi_final_mode.txt index cfb8a60e0..b671246b4 100644 --- a/src/doc/dev/kexi_final_mode.txt +++ b/src/doc/dev/kexi_final_mode.txt @@ -1,21 +1,21 @@ ---------------------- Kexi Final Mode Design ---------------------- 1. Questions / Proposals a) Do we need to store information about needed plugins? The proposal: it's enough as is: needed plugin is checked on object loading. b) Instead having redundant kexi__final, we can easily use kexi__db with for the same purpose? c) More than one startup item would be useful. The proposal: introduce property "startup_items" with a value of ordered int-list of IDs: "32,543,324,532". This is also probably better than a list of names? d) startup-related property (for kexi__db): - "startup_mode", value: "0"==Design Mode, "1"==Final Mode - (default satartup mode; can be overriden by --final-mode and --design-mode) + (default satartup mode; can be overridden by --final-mode and --design-mode) "0" is the default diff --git a/src/widget/KexiFileWidgetInterface.h b/src/widget/KexiFileWidgetInterface.h index 33aa95906..05c1d774f 100644 --- a/src/widget/KexiFileWidgetInterface.h +++ b/src/widget/KexiFileWidgetInterface.h @@ -1,215 +1,215 @@ /* This file is part of the KDE project Copyright (C) 2003-2018 Jarosław Staniek 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 Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KEXIFILEWIDGETINTERFACE_H #define KEXIFILEWIDGETINTERFACE_H #include "kexiextwidgets_export.h" #include #include //! @brief An interface for file widget supporting opening/saving files known by Kexi class KEXIEXTWIDGETS_EXPORT KexiFileWidgetInterface { public: virtual ~KexiFileWidgetInterface(); /** * @brief Creates a file widget * @param startDirOrVariable A URL specifying the initial directory and/or filename, * or using the @c kfiledialog:/// syntax to specify a last used location. * Refer to the KFileWidget::KFileWidget() documentation * for the @c kfiledialog:/// URL syntax. * @param mode File widget's mode * @param fileName Optional file name that is added to the resulting URL. * @param parent File widget's parent widget * * Depending on settings one of two file widget implementations is used: * - if the KEXI_USE_KFILEWIDGET build option is on and KDE Plasma desktop is detected as the * current desktop, KF5's KFileWidget-based widget is created, * - if the KEXI_USE_KFILEWIDGET build option is off or if non-KDE Plasma desktop is detected * as the current desktop, a simple KexiFileRequester widget is created. * - * In addition, if the KEXI_USE_KFILEWIDGET build option is on, defaults can be overriden by + * In addition, if the KEXI_USE_KFILEWIDGET build option is on, defaults can be overridden by * "UseKFileWidget" boolean option in the "File Dialogs" group of the application's config file: * - if "UseKFileWidget" is @c true, KF5's KFileWidget-based widget is created, * - if "UseKFileWidget" is @c false a simple KexiFileRequester widget is created. * * To delete the override, delete the "UseKFileWidget" option in the aplication's config file. * * @return the new file widget. * * @todo Share this code with KReport and Kexi */ static KexiFileWidgetInterface *createWidget(const QUrl &startDirOrVariable, KexiFileFilters::Mode mode, const QString &fileName, QWidget *parent = nullptr) Q_REQUIRED_RESULT; /** * @overload */ static KexiFileWidgetInterface *createWidget(const QUrl &startDirOrVariable, KexiFileFilters::Mode mode, QWidget *parent = nullptr) Q_REQUIRED_RESULT; /** * @brief returns this object casted to QWidget pointer */ inline QWidget *widget() { return dynamic_cast(this); } //! @return mode for filters used in this widget KexiFileFilters::Mode mode() const; //! Sets mode for filters to be used in this widget void setMode(KexiFileFilters::Mode mode); //! @return additional mime types QStringList additionalMimeTypes() const; //! Sets additional mime types, e.g. "text/x-csv" void setAdditionalMimeTypes(const QStringList &mimeTypes); //! @return excluded mime types QStringList excludedMimeTypes() const; //! Set excluded mime types void setExcludedMimeTypes(const QStringList &mimeTypes); /** * Returns the full path of the selected file in the local filesystem. * (Local files only) */ virtual QString selectedFile() const = 0; /** * @brief Sets the file name to preselect to @p name * * This takes absolute URLs and relative file names. */ virtual void setSelectedFile(const QString &name) = 0; /** * @brief Returns @c true if the current URL meets requied constraints, e.g. exists * * Shows appropriate message box if needed. */ bool checkSelectedFile(); /** * @brief Returns the full path of the highlighted file in the local filesystem * * (Local files only) */ virtual QString highlightedFile() const = 0; //! Sets location text //! @todo //virtual void setLocationText(const QString& text) = 0; //! @return default extension QString defaultExtension() const; /** * @brief Sets default extension which will be added after accepting if user didn't provided one * This method is usable when there is more than one filter so there is no rule what extension * should be selected. By default first one is selected. */ void setDefaultExtension(const QString& ext); /** * @return @c true if user should be asked to accept overwriting existing file. * @see setConfirmOverwrites */ bool confirmOverwrites() const; /*! If true, user will be asked to accept overwriting existing file. This is true by default. */ void setConfirmOverwrites(bool set); /** * Sets whether the line edit draws itself with a frame. */ virtual void setWidgetFrame(bool set) = 0; /** * @returns the currently shown directory. * Reimplement it. */ virtual QString currentDir() const; /** * @brief Connects "file hightlighted" signal to specific receiver * * Connects widget's "fileHighlighted(QString)" signal to @a receiver and @a slot. The signal * is emit when a file item is selected or highlighted. * * @note Highlighting happens mostly when user single clicks a file item and * double-click-to-select mode is enabled (see KexiUtils::activateItemsOnSingleClick()). Rather * depend on file delecting than file highlighting. * * @see connectFileSelectedSignal */ void connectFileHighlightedSignal(QObject *receiver, const char *slot); /** * @brief Connects "file selected" signal to specific receiver * * Connects "fileSelected(QString)" signal of widget's returned by widget() to * @a receiver and @a slot. */ void connectFileSelectedSignal(QObject *receiver, const char *slot); protected: KexiFileWidgetInterface(const QUrl &startDirOrVariable, const QString &fileName); /** * @brief Updates filters in the widget based on current filter selection. */ virtual void updateFilters() = 0; /** * @brief Applies filename entered in the location edit * * Matching file item is selected on the files list if possible. */ virtual void applyEnteredFileName() = 0; virtual QStringList currentFilters() const = 0; QUrl startUrl() const; void addRecentDir(const QString &name); KexiFileFilters* filters(); const KexiFileFilters* filters() const; void setFiltersUpdated(bool set); bool filtersUpdated() const; void done(); private: class Private; Private * const d; }; #endif // KEXIFILEWIDGETINTERFACE_H