1 // Copyright (c) 2007-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.
14 // Define the Option Configuration interface class COptionConfig.
27 #ifndef OPTION_CONFIG_H
28 #define OPTION_CONFIG_H
32 #include <streamelement.h>
35 Maximum number of characters allowed for the descriptors of a COptionConfig object.
36 @see COptionConfig* NewL().
38 #define KCDSMaxConfigParamStr 128
45 Class that represents a configuration parameter. It is based on CStreamElementBase so
46 it can be streamed between client and server.
48 class COptionConfig : public CStreamElementBase
60 /** Unsigned integer */
70 /** Set string values allowed. */
83 /** Core Dump Server is owner of the parameter */
86 /** Formatter plugin is owner of the parameter */
89 /** Writer plugin is owner of the parameter */
93 IMPORT_C static COptionConfig* NewL( const TUint32 & aIndex,
95 const TParameterSource & aSource,
96 const TOptionType & aType,
97 const TDesC & aPrompt,
98 const TUint32 & aNumOptions,
99 const TDesC & aOptions,
101 const TDesC & aStrValue );
103 IMPORT_C static COptionConfig* NewL( const TDesC8 & aStreamData );
105 IMPORT_C ~COptionConfig();
108 // Methods specific to COptionConfig
110 IMPORT_C TOptionType Type() const;
111 IMPORT_C TParameterSource Source() const;
112 IMPORT_C TUint32 Index() const;
113 IMPORT_C TUint32 Uid( ) const;
115 IMPORT_C const TDesC & Prompt() const;
117 IMPORT_C TUint32 NumOptions( ) const;
118 IMPORT_C const TDesC & Options() const;
120 IMPORT_C TInt32 Value() const;
121 IMPORT_C TBool ValueAsBool() const;
122 IMPORT_C const TDesC & ValueAsDesc() const;
124 IMPORT_C void Value( const TInt32 aValue );
125 IMPORT_C void ValueL( const TDesC & aValue );
128 // Methods required by streaming interface
130 IMPORT_C static TInt MaxSize();
131 IMPORT_C TInt Size() const;
133 // Initializes ’this’ from stream
134 IMPORT_C void InternalizeL( RReadStream & aStream );
136 // Writes ’this’ to the stream
137 IMPORT_C void ExternalizeL( RWriteStream & aStream, CBufFlat* buf );
142 COptionConfig( const TOptionType & aType,
143 const TParameterSource & aSource,
144 const TUint32 & aIndex,
145 const TUint32 & aUID,
146 const TUint32 & aNumOptions,
147 const TInt32 & aValue );
149 void ConstructStringL( const TDesC & aSource, HBufC ** aDest );
153 void ConstructL( const TDesC & aPrompt,
154 const TDesC & aOptions,
155 const TDesC & aStrValue );
159 // Since this is passed accross the Client Server interface, we should keep the type native.
162 TParameterSource iSource;
164 // This index is not globally unique. It is valid within a group of parameters only.
165 // For example the params from the formatter are say 0 to 3, then for the writer they are 0 to 2.
190 #endif // OPTION_CONFIG_H