1.1 --- a/epoc32/include/fepbconfig.h Tue Mar 16 16:12:26 2010 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,226 +0,0 @@
1.4 -// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 -// All rights reserved.
1.6 -// This component and the accompanying materials are made available
1.7 -// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.8 -// which accompanies this distribution, and is available
1.9 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 -//
1.11 -// Initial Contributors:
1.12 -// Nokia Corporation - initial contribution.
1.13 -//
1.14 -// Contributors:
1.15 -//
1.16 -// Description:
1.17 -//
1.18 -
1.19 -#ifndef __FEPBCONFIG_H__
1.20 -#define __FEPBCONFIG_H__
1.21 -
1.22 -#include <e32base.h>
1.23 -#include <coemain.h> // class CCoeEnv
1.24 -
1.25 -class CRepository;
1.26 -
1.27 -/** Specifies the maximum size of a FEP attribute in bytes.
1.28 -
1.29 -@publishedAll
1.30 -@released */
1.31 -const TInt KCoeFepMaxAttribDataSize = 200;
1.32 -
1.33 -
1.34 -/** On or off key data for FEPs.
1.35 -
1.36 -The CCoeFep class uses instances of this class to specify the key combination which
1.37 -is used to turn the FEP on and off. These values are initialised during construction
1.38 -of the FEP (see CCoeFep::BaseConstructL()).
1.39 -
1.40 -The class consists of three TUints. They represent:
1.41 -
1.42 -- the character code of the key combination
1.43 -
1.44 -- a modifier mask which indicates which modifiers are relevant to the key combination
1.45 -
1.46 -- the modifier values which indicate which of the modifiers specified in the
1.47 -modifier mask must be on and which must be off
1.48 -
1.49 -For example, if the key combination to turn the FEP off is Fn+Enter, where
1.50 -the Shift modifier must not be down (and the state of all other modifiers
1.51 -is irrelevant), the TFepOnOrOffKeyData object would be constructed as follows:
1.52 -
1.53 -@code
1.54 -TFepOnOrOffKeyData(EKeyEnter, EModifierFunc|EModifierShift, EModifierFunc)
1.55 -@endcode
1.56 -
1.57 -Note that modifiers should not be set in the values if they are not also set
1.58 -in the mask.
1.59 -
1.60 -@publishedAll
1.61 -@released */
1.62 -class TFepOnOrOffKeyData
1.63 - {
1.64 -public:
1.65 - inline TFepOnOrOffKeyData(TUint aCharacterCodeForFoldedMatch, TUint aModifierMask, TUint aModifierValues) :iCharacterCodeForFoldedMatch(aCharacterCodeForFoldedMatch), iModifierMask(aModifierMask), iModifierValues(aModifierValues)
1.66 - /** The C++ constructor is used to construct the key data object with the character
1.67 - code, the modifier mask and the modifier values.
1.68 -
1.69 - @param aCharacterCodeForFoldedMatch The character code.
1.70 - @param aModifierMask The modifier mask.
1.71 - @param aModifierValues The modifier values. */
1.72 - {}
1.73 -
1.74 - inline TUint CharacterCodeForFoldedMatch() const
1.75 - /** Gets the character code.
1.76 -
1.77 - @return The character code. */
1.78 - {return iCharacterCodeForFoldedMatch;}
1.79 - inline TUint ModifierMask() const
1.80 - /** Gets the modifier mask.
1.81 -
1.82 - @return The modifier mask. */
1.83 - {return iModifierMask;}
1.84 - inline TUint ModifierValues() const
1.85 - /** Gets the modifier values.
1.86 -
1.87 - @return The modifier values. */
1.88 - {return iModifierValues;}
1.89 - /**
1.90 - Checks if 2 TFepOnOrOffKeyData objects have the same values.
1.91 -
1.92 - returns Etrue if the 2 objects have the same values, EFalse otherwise
1.93 - */
1.94 - IMPORT_C TBool operator==(const TFepOnOrOffKeyData& aAnother) const;
1.95 -
1.96 -
1.97 - /**
1.98 - Checks if 2 TFepOnOrOffKeyData objects do not have the the same values.
1.99 -
1.100 - returns Etrue if the 2 objects have the same values, EFalse otherwise
1.101 - */
1.102 - IMPORT_C TBool operator!=(const TFepOnOrOffKeyData& aAnother) const;
1.103 -private:
1.104 - TUint iCharacterCodeForFoldedMatch;
1.105 - TUint iModifierMask;
1.106 - TUint iModifierValues;
1.107 - };
1.108 -
1.109 -class CDictionaryStore;
1.110 -class RWriteStream;
1.111 -class RReadStream;
1.112 -
1.113 -
1.114 -/** Reads and writes generic FEP settings.
1.115 -
1.116 -Used by the CCoeFep class. The generic FEP settings are whether the FEP is
1.117 -on or off and what key combinations should turn the FEP on or off. Also used
1.118 -to synchronise these settings across all running instances of the FEP. These
1.119 -settings are generic, unlike FEP attributes which are FEP-specific. FEP attributes
1.120 -are stored, restored and synchronised using class MFepAttributeStorer. Generic
1.121 -FEP settings are changed locally using the Set...() member functions. Then,
1.122 -to store these as the system settings and to apply them globally, call StoreChangesAndBroadcastL().
1.123 -
1.124 -Class CCoeFep initialises its generic FEP settings from the global system
1.125 -settings during construction. Its generic FEP settings are updated when the
1.126 -settings are changed by a call to StoreChangesAndBroadcastL() by another running
1.127 -instance of the FEP.
1.128 -
1.129 -@publishedAll
1.130 -@released */
1.131 -class CFepGenericGlobalSettings : public CBase
1.132 - {
1.133 -public:
1.134 - IMPORT_C static CFepGenericGlobalSettings* NewL(CCoeEnv& aConeEnvironment, const TFepOnOrOffKeyData& aDefaultOnKeyData, const TFepOnOrOffKeyData& aDefaultOffKeyData, TBool aDefaultIsOn);
1.135 - IMPORT_C static CFepGenericGlobalSettings* NewLC(CCoeEnv& aConeEnvironment, const TFepOnOrOffKeyData& aDefaultOnKeyData, const TFepOnOrOffKeyData& aDefaultOffKeyData, TBool aDefaultIsOn);
1.136 - IMPORT_C static CFepGenericGlobalSettings* NewL();
1.137 - IMPORT_C static CFepGenericGlobalSettings* NewLC();
1.138 - IMPORT_C TFepOnOrOffKeyData OnKeyData() const;
1.139 - IMPORT_C void SetOnKeyData(const TFepOnOrOffKeyData& aOnKeyData);
1.140 - IMPORT_C TFepOnOrOffKeyData OffKeyData() const;
1.141 - IMPORT_C void SetOffKeyData(const TFepOnOrOffKeyData& aOffKeyData);
1.142 - IMPORT_C TBool IsOn() const;
1.143 - IMPORT_C void SetIsOn(TBool aIsOn);
1.144 - IMPORT_C void StoreChangesAndBroadcastL();
1.145 - IMPORT_C void RefreshL();
1.146 -public: // not for external use
1.147 - IMPORT_C static void ReadOnState(CRepository& aRepository, TBool& aOnState, TInt* aError=NULL);
1.148 - IMPORT_C static void ReadOnOrOffKeyData(CRepository& aRepository, TFepOnOrOffKeyData& aOnOrOffKeyData, TUint32 aRepositoryKeyMask_OnOrOff, TInt* aError=NULL);
1.149 - IMPORT_C static void WriteOnStateAndBroadcastL(CRepository& aRepository, TBool aOnState, TUint32 aRepositoryKeyMask_DefaultOrDynamic);
1.150 - IMPORT_C static void WriteOnOrOffKeyDataAndBroadcastL(CRepository& aRepository, const TFepOnOrOffKeyData& aOnOrOffKeyData, TUint32 aRepositoryKey);
1.151 -private:
1.152 - CFepGenericGlobalSettings();
1.153 - void ConstructL();
1.154 -private:
1.155 - enum
1.156 - {
1.157 - EFlagIsOn =0x00000001,
1.158 - // the EFlagStoreXxx flags below indicate whether this object has had any SetXxx functions called on it, which can be used to optimize what work StoreChangesAndBroadcastL has to do
1.159 - EFlagStoreIsOn =0x00000002,
1.160 - EFlagStoreOnKeyData =0x00000004,
1.161 - EFlagStoreOffKeyData =0x00000008
1.162 - };
1.163 -private:
1.164 - TUint iFlags;
1.165 - TFepOnOrOffKeyData iOnKeyData;
1.166 - TFepOnOrOffKeyData iOffKeyData;
1.167 - };
1.168 -
1.169 -
1.170 -/** Protocol for storing, restoring and synchronising FEP attributes.
1.171 -
1.172 -An abstract base class for CCoeFep, so FEPs must implement the pure virtual
1.173 -functions declared in this class.
1.174 -
1.175 -Rather than using a single device-wide instance of a FEP, each application
1.176 -has its own instance of the FEP. MFepAttributeStorer provides a framework
1.177 -for synchronising FEP attributes across each running instance of the same
1.178 -FEP. For this to happen, the FEP must implement MFepAttributeStorer::WriteAttributeDataToStreamL()
1.179 -and MFepAttributeStorer::ReadAttributeDataFromStreamL().
1.180 -
1.181 -Attributes are FEP-specific, and are identified by a UID which can be accessed
1.182 -using AttributeAtIndex(). An example of a FEP attribute might be whether inline
1.183 -editing is enabled or disabled.
1.184 -
1.185 -@publishedAll
1.186 -@released */
1.187 -class MFepAttributeStorer
1.188 - {
1.189 -public:
1.190 - IMPORT_C void ReadAllAttributesL(CCoeEnv& aConeEnvironment);
1.191 - IMPORT_C void WriteAttributeDataAndBroadcastL(CCoeEnv& aConeEnvironment, TUid aAttributeUid);
1.192 - IMPORT_C void WriteAttributeDataAndBroadcastL(CCoeEnv& aConeEnvironment, const TArray<TUid>& aAttributeUids);
1.193 - /** Returns the total number of FEP attributes.
1.194 -
1.195 - @return The number of FEP attributes. */
1.196 - virtual TInt NumberOfAttributes() const=0;
1.197 - /** Returns the UID of the FEP attribute at the index specified.
1.198 -
1.199 - @param aIndex An array index.
1.200 - @return The UID of the FEP attribute at aIndex. */
1.201 - virtual TUid AttributeAtIndex(TInt aIndex) const=0;
1.202 - /** Writes the value of the attribute specified to the specified write stream.
1.203 -
1.204 - Called by MFepAttributeStorer::WriteAttributeDataAndBroadcastL() for each
1.205 - attribute passed to it.
1.206 -
1.207 - @param aAttributeUid UID of the attribute to write to the stream.
1.208 - @param aStream The stream to which to write the attribute. */
1.209 - virtual void WriteAttributeDataToStreamL(TUid aAttributeUid, RWriteStream& aStream) const=0;
1.210 - /** Reads the value of the attribute identified by the UID specified in aAttributeUid
1.211 - from the specified read stream.
1.212 -
1.213 - You should take appropriate action if the attribute has changed, e.g.
1.214 - if inline editing has been disabled, you might cancel the current transaction.
1.215 -
1.216 - This function is called by MFepAttributeStorer::ReadAllAttributesL() for all
1.217 - attributes. It is also called when the FEP receives a message that an attribute
1.218 - has been changed by another running instance of the FEP (using WriteAttributeDataAndBroadcastL()).
1.219 -
1.220 - @param aAttributeUid Identifies the attribute whose value should be read.
1.221 - @param aStream Read stream from which to read the attribute's value. */
1.222 - virtual void ReadAttributeDataFromStreamL(TUid aAttributeUid, RReadStream& aStream)=0;
1.223 -private:
1.224 - IMPORT_C virtual void MFepAttributeStorer_Reserved_1();
1.225 - IMPORT_C virtual void MFepAttributeStorer_Reserved_2();
1.226 - TInt NumberOfOccurrencesOfAttributeUid(TUid aAttributeUid) const;
1.227 - };
1.228 -
1.229 -#endif // __FEPBCONFIG_H__