Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // 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
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __FEPBCONFIG_H__
17 #define __FEPBCONFIG_H__
20 #include <coemain.h> // class CCoeEnv
24 /** Specifies the maximum size of a FEP attribute in bytes.
28 const TInt KCoeFepMaxAttribDataSize = 200;
31 /** On or off key data for FEPs.
33 The CCoeFep class uses instances of this class to specify the key combination which
34 is used to turn the FEP on and off. These values are initialised during construction
35 of the FEP (see CCoeFep::BaseConstructL()).
37 The class consists of three TUints. They represent:
39 - the character code of the key combination
41 - a modifier mask which indicates which modifiers are relevant to the key combination
43 - the modifier values which indicate which of the modifiers specified in the
44 modifier mask must be on and which must be off
46 For example, if the key combination to turn the FEP off is Fn+Enter, where
47 the Shift modifier must not be down (and the state of all other modifiers
48 is irrelevant), the TFepOnOrOffKeyData object would be constructed as follows:
51 TFepOnOrOffKeyData(EKeyEnter, EModifierFunc|EModifierShift, EModifierFunc)
54 Note that modifiers should not be set in the values if they are not also set
59 class TFepOnOrOffKeyData
62 inline TFepOnOrOffKeyData(TUint aCharacterCodeForFoldedMatch, TUint aModifierMask, TUint aModifierValues) :iCharacterCodeForFoldedMatch(aCharacterCodeForFoldedMatch), iModifierMask(aModifierMask), iModifierValues(aModifierValues)
63 /** The C++ constructor is used to construct the key data object with the character
64 code, the modifier mask and the modifier values.
66 @param aCharacterCodeForFoldedMatch The character code.
67 @param aModifierMask The modifier mask.
68 @param aModifierValues The modifier values. */
71 inline TUint CharacterCodeForFoldedMatch() const
72 /** Gets the character code.
74 @return The character code. */
75 {return iCharacterCodeForFoldedMatch;}
76 inline TUint ModifierMask() const
77 /** Gets the modifier mask.
79 @return The modifier mask. */
80 {return iModifierMask;}
81 inline TUint ModifierValues() const
82 /** Gets the modifier values.
84 @return The modifier values. */
85 {return iModifierValues;}
87 Checks if 2 TFepOnOrOffKeyData objects have the same values.
89 returns Etrue if the 2 objects have the same values, EFalse otherwise
91 IMPORT_C TBool operator==(const TFepOnOrOffKeyData& aAnother) const;
95 Checks if 2 TFepOnOrOffKeyData objects do not have the the same values.
97 returns Etrue if the 2 objects have the same values, EFalse otherwise
99 IMPORT_C TBool operator!=(const TFepOnOrOffKeyData& aAnother) const;
101 TUint iCharacterCodeForFoldedMatch;
103 TUint iModifierValues;
106 class CDictionaryStore;
111 /** Reads and writes generic FEP settings.
113 Used by the CCoeFep class. The generic FEP settings are whether the FEP is
114 on or off and what key combinations should turn the FEP on or off. Also used
115 to synchronise these settings across all running instances of the FEP. These
116 settings are generic, unlike FEP attributes which are FEP-specific. FEP attributes
117 are stored, restored and synchronised using class MFepAttributeStorer. Generic
118 FEP settings are changed locally using the Set...() member functions. Then,
119 to store these as the system settings and to apply them globally, call StoreChangesAndBroadcastL().
121 Class CCoeFep initialises its generic FEP settings from the global system
122 settings during construction. Its generic FEP settings are updated when the
123 settings are changed by a call to StoreChangesAndBroadcastL() by another running
128 class CFepGenericGlobalSettings : public CBase
131 IMPORT_C static CFepGenericGlobalSettings* NewL(CCoeEnv& aConeEnvironment, const TFepOnOrOffKeyData& aDefaultOnKeyData, const TFepOnOrOffKeyData& aDefaultOffKeyData, TBool aDefaultIsOn);
132 IMPORT_C static CFepGenericGlobalSettings* NewLC(CCoeEnv& aConeEnvironment, const TFepOnOrOffKeyData& aDefaultOnKeyData, const TFepOnOrOffKeyData& aDefaultOffKeyData, TBool aDefaultIsOn);
133 IMPORT_C static CFepGenericGlobalSettings* NewL();
134 IMPORT_C static CFepGenericGlobalSettings* NewLC();
135 IMPORT_C TFepOnOrOffKeyData OnKeyData() const;
136 IMPORT_C void SetOnKeyData(const TFepOnOrOffKeyData& aOnKeyData);
137 IMPORT_C TFepOnOrOffKeyData OffKeyData() const;
138 IMPORT_C void SetOffKeyData(const TFepOnOrOffKeyData& aOffKeyData);
139 IMPORT_C TBool IsOn() const;
140 IMPORT_C void SetIsOn(TBool aIsOn);
141 IMPORT_C void StoreChangesAndBroadcastL();
142 IMPORT_C void RefreshL();
143 public: // not for external use
144 IMPORT_C static void ReadOnState(CRepository& aRepository, TBool& aOnState, TInt* aError=NULL);
145 IMPORT_C static void ReadOnOrOffKeyData(CRepository& aRepository, TFepOnOrOffKeyData& aOnOrOffKeyData, TUint32 aRepositoryKeyMask_OnOrOff, TInt* aError=NULL);
146 IMPORT_C static void WriteOnStateAndBroadcastL(CRepository& aRepository, TBool aOnState, TUint32 aRepositoryKeyMask_DefaultOrDynamic);
147 IMPORT_C static void WriteOnOrOffKeyDataAndBroadcastL(CRepository& aRepository, const TFepOnOrOffKeyData& aOnOrOffKeyData, TUint32 aRepositoryKey);
149 CFepGenericGlobalSettings();
154 EFlagIsOn =0x00000001,
155 // 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
156 EFlagStoreIsOn =0x00000002,
157 EFlagStoreOnKeyData =0x00000004,
158 EFlagStoreOffKeyData =0x00000008
162 TFepOnOrOffKeyData iOnKeyData;
163 TFepOnOrOffKeyData iOffKeyData;
167 /** Protocol for storing, restoring and synchronising FEP attributes.
169 An abstract base class for CCoeFep, so FEPs must implement the pure virtual
170 functions declared in this class.
172 Rather than using a single device-wide instance of a FEP, each application
173 has its own instance of the FEP. MFepAttributeStorer provides a framework
174 for synchronising FEP attributes across each running instance of the same
175 FEP. For this to happen, the FEP must implement MFepAttributeStorer::WriteAttributeDataToStreamL()
176 and MFepAttributeStorer::ReadAttributeDataFromStreamL().
178 Attributes are FEP-specific, and are identified by a UID which can be accessed
179 using AttributeAtIndex(). An example of a FEP attribute might be whether inline
180 editing is enabled or disabled.
184 class MFepAttributeStorer
187 IMPORT_C void ReadAllAttributesL(CCoeEnv& aConeEnvironment);
188 IMPORT_C void WriteAttributeDataAndBroadcastL(CCoeEnv& aConeEnvironment, TUid aAttributeUid);
189 IMPORT_C void WriteAttributeDataAndBroadcastL(CCoeEnv& aConeEnvironment, const TArray<TUid>& aAttributeUids);
190 /** Returns the total number of FEP attributes.
192 @return The number of FEP attributes. */
193 virtual TInt NumberOfAttributes() const=0;
194 /** Returns the UID of the FEP attribute at the index specified.
196 @param aIndex An array index.
197 @return The UID of the FEP attribute at aIndex. */
198 virtual TUid AttributeAtIndex(TInt aIndex) const=0;
199 /** Writes the value of the attribute specified to the specified write stream.
201 Called by MFepAttributeStorer::WriteAttributeDataAndBroadcastL() for each
202 attribute passed to it.
204 @param aAttributeUid UID of the attribute to write to the stream.
205 @param aStream The stream to which to write the attribute. */
206 virtual void WriteAttributeDataToStreamL(TUid aAttributeUid, RWriteStream& aStream) const=0;
207 /** Reads the value of the attribute identified by the UID specified in aAttributeUid
208 from the specified read stream.
210 You should take appropriate action if the attribute has changed, e.g.
211 if inline editing has been disabled, you might cancel the current transaction.
213 This function is called by MFepAttributeStorer::ReadAllAttributesL() for all
214 attributes. It is also called when the FEP receives a message that an attribute
215 has been changed by another running instance of the FEP (using WriteAttributeDataAndBroadcastL()).
217 @param aAttributeUid Identifies the attribute whose value should be read.
218 @param aStream Read stream from which to read the attribute's value. */
219 virtual void ReadAttributeDataFromStreamL(TUid aAttributeUid, RReadStream& aStream)=0;
221 IMPORT_C virtual void MFepAttributeStorer_Reserved_1();
222 IMPORT_C virtual void MFepAttributeStorer_Reserved_2();
223 TInt NumberOfOccurrencesOfAttributeUid(TUid aAttributeUid) const;
226 #endif // __FEPBCONFIG_H__