LCOV - code coverage report
Current view: top level - framework/inc - properties.h (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 9 9 100.0 %
Date: 2015-06-13 12:38:46 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #ifndef INCLUDED_FRAMEWORK_INC_PROPERTIES_H
      21             : #define INCLUDED_FRAMEWORK_INC_PROPERTIES_H
      22             : 
      23             : #include <macros/generic.hxx>
      24             : #include "general.h"
      25             : 
      26             : namespace framework{
      27             : 
      28             : /** properties for "Frame" class */
      29             : 
      30             : #define FRAME_PROPNAME_ASCII_DISPATCHRECORDERSUPPLIER   "DispatchRecorderSupplier"
      31             : #define FRAME_PROPNAME_ASCII_ISHIDDEN                   "IsHidden"
      32             : #define FRAME_PROPNAME_ASCII_LAYOUTMANAGER              "LayoutManager"
      33             : #define FRAME_PROPNAME_ASCII_TITLE                      "Title"
      34             : #define FRAME_PROPNAME_ASCII_INDICATORINTERCEPTION      "IndicatorInterception"
      35             : 
      36             : #define FRAME_PROPNAME_DISPATCHRECORDERSUPPLIER         DECLARE_ASCII(FRAME_PROPNAME_ASCII_DISPATCHRECORDERSUPPLIER)
      37             : #define FRAME_PROPNAME_ISHIDDEN                         DECLARE_ASCII(FRAME_PROPNAME_ASCII_ISHIDDEN                )
      38             : #define FRAME_PROPNAME_LAYOUTMANAGER                    DECLARE_ASCII(FRAME_PROPNAME_ASCII_LAYOUTMANAGER           )
      39             : #define FRAME_PROPNAME_TITLE                            DECLARE_ASCII(FRAME_PROPNAME_ASCII_TITLE                   )
      40             : #define FRAME_PROPNAME_INDICATORINTERCEPTION            DECLARE_ASCII(FRAME_PROPNAME_ASCII_INDICATORINTERCEPTION   )
      41             : 
      42             : // Please add new entries alphabetical sorted and correct all other handles!
      43             : // Start counting with 0, so it can be used as direct index into an array too.
      44             : // Don't forget updating of define FRAME_PROPCOUNT below!!!
      45             : #define FRAME_PROPHANDLE_DISPATCHRECORDERSUPPLIER       0
      46             : #define FRAME_PROPHANDLE_ISHIDDEN                       1
      47             : #define FRAME_PROPHANDLE_LAYOUTMANAGER                  2
      48             : #define FRAME_PROPHANDLE_TITLE                          3
      49             : #define FRAME_PROPHANDLE_INDICATORINTERCEPTION          4
      50             : 
      51             : #define FRAME_PROPCOUNT                                 5
      52             : 
      53             : /** properties for "Desktop" class */
      54             : 
      55             : #define DESKTOP_PROPNAME_ASCII_ACTIVEFRAME              "ActiveFrame"
      56             : #define DESKTOP_PROPNAME_ASCII_DISPATCHRECORDERSUPPLIER "DispatchRecorderSupplier"
      57             : #define DESKTOP_PROPNAME_ASCII_ISPLUGGED                "IsPlugged"
      58             : #define DESKTOP_PROPNAME_ASCII_SUSPENDQUICKSTARTVETO    "SuspendQuickstartVeto"
      59             : #define DESKTOP_PROPNAME_ASCII_TITLE                    "Title"
      60             : 
      61             : #define DESKTOP_PROPNAME_ACTIVEFRAME                    DECLARE_ASCII(DESKTOP_PROPNAME_ASCII_ACTIVEFRAME             )
      62             : #define DESKTOP_PROPNAME_DISPATCHRECORDERSUPPLIER       DECLARE_ASCII(DESKTOP_PROPNAME_ASCII_DISPATCHRECORDERSUPPLIER)
      63             : #define DESKTOP_PROPNAME_ISPLUGGED                      DECLARE_ASCII(DESKTOP_PROPNAME_ASCII_ISPLUGGED               )
      64             : #define DESKTOP_PROPNAME_SUSPENDQUICKSTARTVETO          DECLARE_ASCII(DESKTOP_PROPNAME_ASCII_SUSPENDQUICKSTARTVETO   )
      65             : #define DESKTOP_PROPNAME_TITLE                          DECLARE_ASCII(DESKTOP_PROPNAME_ASCII_TITLE                   )
      66             : 
      67             : // Please add new entries alphabetical sorted and correct all other handles!
      68             : // Start counting with 0, so it can be used as direct index into an array too.
      69             : // Don't forget updating of define DESKTOP_PROPCOUNT below!!!
      70             : #define DESKTOP_PROPHANDLE_ACTIVEFRAME                  0
      71             : #define DESKTOP_PROPHANDLE_DISPATCHRECORDERSUPPLIER     1
      72             : #define DESKTOP_PROPHANDLE_ISPLUGGED                    2
      73             : #define DESKTOP_PROPHANDLE_SUSPENDQUICKSTARTVETO        3
      74             : #define DESKTOP_PROPHANDLE_TITLE                        4
      75             : 
      76             : #define DESKTOP_PROPCOUNT                               5
      77             : 
      78             : /** properties for "PathSettings" class */
      79             : 
      80             : #define PATHSETTINGS_PROPNAME_ASCII_ADDIN               "Addin"
      81             : #define PATHSETTINGS_PROPNAME_ASCII_AUTOCORRECT         "AutoCorrect"
      82             : #define PATHSETTINGS_PROPNAME_ASCII_AUTOTEXT            "AutoText"
      83             : #define PATHSETTINGS_PROPNAME_ASCII_BACKUP              "Backup"
      84             : #define PATHSETTINGS_PROPNAME_ASCII_BASIC               "Basic"
      85             : #define PATHSETTINGS_PROPNAME_ASCII_BITMAP              "Bitmap"
      86             : #define PATHSETTINGS_PROPNAME_ASCII_CONFIG              "Config"
      87             : #define PATHSETTINGS_PROPNAME_ASCII_DICTIONARY          "Dictionary"
      88             : #define PATHSETTINGS_PROPNAME_ASCII_FAVORITE            "Favorite"
      89             : #define PATHSETTINGS_PROPNAME_ASCII_FILTER              "Filter"
      90             : #define PATHSETTINGS_PROPNAME_ASCII_GALLERY             "Gallery"
      91             : #define PATHSETTINGS_PROPNAME_ASCII_GRAPHIC             "Graphic"
      92             : #define PATHSETTINGS_PROPNAME_ASCII_HELP                "Help"
      93             : #define PATHSETTINGS_PROPNAME_ASCII_LINGUISTIC          "Linguistic"
      94             : #define PATHSETTINGS_PROPNAME_ASCII_MODULE              "Module"
      95             : #define PATHSETTINGS_PROPNAME_ASCII_PALETTE             "Palette"
      96             : #define PATHSETTINGS_PROPNAME_ASCII_PLUGIN              "Plugin"
      97             : #define PATHSETTINGS_PROPNAME_ASCII_STORAGE             "Storage"
      98             : #define PATHSETTINGS_PROPNAME_ASCII_TEMP                "Temp"
      99             : #define PATHSETTINGS_PROPNAME_ASCII_TEMPLATE            "Template"
     100             : #define PATHSETTINGS_PROPNAME_ASCII_UICONFIG            "UIConfig"
     101             : #define PATHSETTINGS_PROPNAME_ASCII_USERCONFIG          "UserConfig"
     102             : #define PATHSETTINGS_PROPNAME_ASCII_USERDICTIONARY      "UserDictionary"
     103             : #define PATHSETTINGS_PROPNAME_ASCII_WORK                "Work"
     104             : 
     105             : #define PATHSETTINGS_PROPCOUNT                          24
     106             : 
     107             : /** properties for "LayoutManager" class */
     108             : 
     109             : #define LAYOUTMANAGER_PROPNAME_ASCII_MENUBARCLOSER          "MenuBarCloser"
     110             : #define LAYOUTMANAGER_PROPNAME_ASCII_AUTOMATICTOOLBARS      "AutomaticToolbars"
     111             : #define LAYOUTMANAGER_PROPNAME_ASCII_REFRESHVISIBILITY      "RefreshContextToolbarVisibility"
     112             : #define LAYOUTMANAGER_PROPNAME_ASCII_HIDECURRENTUI          "HideCurrentUI"
     113             : #define LAYOUTMANAGER_PROPNAME_ASCII_LOCKCOUNT              "LockCount"
     114             : #define LAYOUTMANAGER_PROPNAME_ASCII_PRESERVE_CONTENT_SIZE  "PreserveContentSize"
     115             : 
     116             : #define LAYOUTMANAGER_PROPNAME_MENUBARCLOSER            OUString( LAYOUTMANAGER_PROPNAME_ASCII_MENUBARCLOSER )
     117             : #define LAYOUTMANAGER_PROPNAME_AUTOMATICTOOLBARS        OUString( LAYOUTMANAGER_PROPNAME_ASCII_AUTOMATICTOOLBARS )
     118             : #define LAYOUTMANAGER_PROPNAME_REFRESHVISIBILITY        OUString( LAYOUTMANAGER_PROPNAME_ASCII_REFRESHVISIBILITY )
     119             : #define LAYOUTMANAGER_PROPNAME_HIDECURRENTUI            OUString( LAYOUTMANAGER_PROPNAME_ASCII_HIDECURRENTUI )
     120             : #define LAYOUTMANAGER_PROPNAME_LOCKCOUNT                OUString( LAYOUTMANAGER_PROPNAME_ASCII_LOCKCOUNT )
     121             : #define LAYOUTMANAGER_PROPNAME_PRESERVE_CONTENT_SIZE    OUString( LAYOUTMANAGER_PROPNAME_ASCII_PRESERVE_CONTENT_SIZE )
     122             : 
     123             : #define LAYOUTMANAGER_PROPHANDLE_MENUBARCLOSER          0
     124             : #define LAYOUTMANAGER_PROPHANDLE_AUTOMATICTOOLBARS      1
     125             : #define LAYOUTMANAGER_PROPHANDLE_REFRESHVISIBILITY      2
     126             : #define LAYOUTMANAGER_PROPHANDLE_HIDECURRENTUI          3
     127             : #define LAYOUTMANAGER_PROPHANDLE_LOCKCOUNT              4
     128             : #define LAYOUTMANAGER_PROPHANDLE_PRESERVE_CONTENT_SIZE  5
     129             : 
     130             : /** properties for "UICommandDescription" class */
     131             : #define UICOMMANDDESCRIPTION_NAMEACCESS_COMMANDIMAGELIST        "private:resource/image/commandimagelist"
     132             : #define UICOMMANDDESCRIPTION_NAMEACCESS_COMMANDROTATEIMAGELIST  "private:resource/image/commandrotateimagelist"
     133             : #define UICOMMANDDESCRIPTION_NAMEACCESS_COMMANDMIRRORIMAGELIST  "private:resource/image/commandmirrorimagelist"
     134             : 
     135             : 
     136             : #define UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON            8
     137             : 
     138             : /** properties for "AutoRecovery" class */
     139             : 
     140             : #define AUTORECOVERY_PROPNAME_ASCII_EXISTS_RECOVERYDATA "ExistsRecoveryData"
     141             : #define AUTORECOVERY_PROPNAME_ASCII_EXISTS_SESSIONDATA  "ExistsSessionData"
     142             : #define AUTORECOVERY_PROPNAME_ASCII_CRASHED             "Crashed"
     143             : 
     144             : #define AUTORECOVERY_PROPNAME_EXISTS_RECOVERYDATA       OUString( AUTORECOVERY_PROPNAME_ASCII_EXISTS_RECOVERYDATA )
     145             : #define AUTORECOVERY_PROPNAME_EXISTS_SESSIONDATA        OUString( AUTORECOVERY_PROPNAME_ASCII_EXISTS_SESSIONDATA )
     146             : #define AUTORECOVERY_PROPNAME_CRASHED                   OUString( AUTORECOVERY_PROPNAME_ASCII_CRASHED )
     147             : 
     148             : #define AUTORECOVERY_PROPHANDLE_EXISTS_RECOVERYDATA     0
     149             : #define AUTORECOVERY_PROPHANDLE_EXISTS_SESSIONDATA      1
     150             : #define AUTORECOVERY_PROPHANDLE_CRASHED                 2
     151             : 
     152             : #define AUTORECOVERY_PROPCOUNT                          3
     153             : 
     154             : /** properties for Filter config */
     155             : 
     156             : #define FILTER_PROPNAME_ASCII_DOCUMENTSERVICE           "DocumentService"
     157             : 
     158             : #define FILTER_PROPNAME_DOCUMENTSERVICE                 OUString( FILTER_PROPNAME_ASCII_DOCUMENTSERVICE )
     159             : 
     160             : /** properties for office module config (Setup.xcu) */
     161             : 
     162             : #define OFFICEFACTORY_PROPNAME_ASCII_WINDOWATTRIBUTES   "ooSetupFactoryWindowAttributes"
     163             : #define OFFICEFACTORY_PROPNAME_ASCII_UINAME             "ooSetupFactoryUIName"
     164             : #define OFFICEFACTORY_PROPNAME_ASCII_ICON               "ooSetupFactoryIcon"
     165             : 
     166             : #define OFFICEFACTORY_PROPNAME_WINDOWATTRIBUTES         OUString( OFFICEFACTORY_PROPNAME_ASCII_WINDOWATTRIBUTES )
     167             : #define OFFICEFACTORY_PROPNAME_UINAME                   OUString( OFFICEFACTORY_PROPNAME_ASCII_UINAME )
     168             : #define OFFICEFACTORY_PROPNAME_ICON                     OUString( OFFICEFACTORY_PROPNAME_ASCII_ICON )
     169             : 
     170             : /** properties for tab window (old) */
     171             : #define TABWINDOW_PROPNAME_ASCII_PARENTWINDOW           "ParentWindow"
     172             : #define TABWINDOW_PROPNAME_ASCII_TOPWINDOW              "TopWindow"
     173             : #define TABWINDOW_PROPNAME_PARENTWINDOW                 OUString( TABWINDOW_PROPNAME_ASCII_PARENTWINDOW )
     174             : #define TABWINDOW_PROPNAME_TOPWINDOW                    OUString( TABWINDOW_PROPNAME_ASCII_TOPWINDOW )
     175             : 
     176             : #define TABWINDOW_PROPHANDLE_PARENTWINDOW               0
     177             : #define TABWINDOW_PROPHANDLE_TOPWINDOW                  1
     178             : #define TABWINDOW_PROPCOUNT                             2
     179             : 
     180             : #define TABWINDOWSERVICE_PROPHANDLE_WINDOW              0
     181             : 
     182             : /** provides some helper methods to implement property sets. */
     183             : 
     184             : class PropHelper
     185             : {
     186             :     public:
     187             : 
     188             :     /** checks if given property will be changed by this settings.
     189             :      *  We compare the content of the given any values. If they are different we return sal_True - sal_False otherwise.
     190             :      *
     191             :      *  @param  aCurrentValue   contains the current value for this property
     192             :      *  @param  aNewValue       contains the new value for this property
     193             :      *  @param  aOldValue       returns the current value, in case something will be changed
     194             :      *  @param  aChangedValue   returns the new value, in case something will be changed
     195             :      *
     196             :      *  @return <True/> if value of this property will be changed; <False/> otherwise.
     197             :      */
     198             : 
     199           1 :     static bool willPropertyBeChanged( const css::uno::Any& aCurrentValue ,
     200             :                                            const css::uno::Any& aNewValue     ,
     201             :                                                  css::uno::Any& aOldValue     ,
     202             :                                                  css::uno::Any& aChangedValue )
     203             :     {
     204           1 :         bool bChanged = sal_False;
     205             : 
     206             :         // clear return parameter to be sure, to put out only valid values ...
     207           1 :         aOldValue.clear();
     208           1 :         aChangedValue.clear();
     209             : 
     210             :         // if value change ...
     211           1 :         bChanged = !(aCurrentValue==aNewValue);
     212           1 :         if (bChanged)
     213             :         {
     214             :             // ... set information of change.
     215           1 :             aOldValue     = aCurrentValue;
     216           1 :             aChangedValue = aNewValue;
     217             :         }
     218             : 
     219           1 :         return bChanged;
     220             :     }
     221             : };
     222             : 
     223             : } // namespace framework
     224             : 
     225             : #endif // INCLUDED_FRAMEWORK_INC_PROPERTIES_H
     226             : 
     227             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11