|
1 // Copyright (c) 2002-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 "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // $Header$ |
|
15 // This header file provides the CIFControl methods and members |
|
16 // |
|
17 // |
|
18 |
|
19 #ifndef __CIFCONTROL_H__ |
|
20 #define __CIFCONTROL_H__ |
|
21 |
|
22 //----------------------------------------------------------------------------- |
|
23 // INCLUDES |
|
24 |
|
25 #include <e32base.h> |
|
26 |
|
27 //----------------------------------------------------------------------------- |
|
28 |
|
29 class CIFControl : public CBase |
|
30 { |
|
31 public: |
|
32 |
|
33 // helper defs and methods for IfMode (IF, ELSE, ENDIF) processing |
|
34 |
|
35 // IFMode indicates the RESULT of the current IF clause |
|
36 enum TIFMode |
|
37 { |
|
38 ENotIf, |
|
39 EIFTrue, |
|
40 EELSETrue, |
|
41 EENDIF, |
|
42 EMAXIFMode |
|
43 }; |
|
44 |
|
45 // IFProcessing indicates the RESULT of the current IF clause |
|
46 enum TIFProcessing |
|
47 { |
|
48 EIgnoreIF, |
|
49 EInIF, |
|
50 EInELSE, |
|
51 EMAXIFProcesses |
|
52 }; |
|
53 |
|
54 // aMaxLength sets the maximum length of formatted output. |
|
55 static CIFControl* NewL (); |
|
56 static CIFControl* NewLC(); |
|
57 static CIFControl* NewL (const CIFControl::TIFMode &, |
|
58 const TBool &, |
|
59 const CIFControl::TIFProcessing &); |
|
60 static CIFControl* NewLC(const CIFControl::TIFMode &, |
|
61 const TBool &, |
|
62 const CIFControl::TIFProcessing &); |
|
63 ~CIFControl(); |
|
64 |
|
65 private: // Constructors and destructors |
|
66 |
|
67 void ConstructL(const CIFControl::TIFMode &, |
|
68 const TBool &, |
|
69 const CIFControl::TIFProcessing &); |
|
70 CIFControl() {}; |
|
71 |
|
72 public: // New functions |
|
73 |
|
74 TIFMode GetIFMode() const; |
|
75 void SetIFMode(const TIFMode &); |
|
76 TIFProcessing GetIFState() const; |
|
77 void SetIFState(const TIFProcessing &); |
|
78 |
|
79 TBool GetIFResult(); |
|
80 TInt GetIfCount(); |
|
81 TInt GetElseCount(); |
|
82 |
|
83 void If(void); |
|
84 void Else(void); |
|
85 void EndIf(void); |
|
86 |
|
87 private: // Data |
|
88 |
|
89 TIFMode iIfMode; // if nonzero then we're in an IF/ELSE/ENDIF (1=IF, 2=ELSE) Endif resets to 0 |
|
90 TBool iIfResult; // this holds the result of the if command that's being executed |
|
91 TBool iInIF; // indicate where we are when processing |
|
92 TIFProcessing iIfStatus; |
|
93 |
|
94 // in clause management |
|
95 TInt iIfs; // counter IF nesting process... |
|
96 TInt iElses; // while processing an IF/ELSE |
|
97 |
|
98 }; |
|
99 |
|
100 //----------------------------------------------------------------------------- |
|
101 |
|
102 #endif //__CIFCONTROL_H__ |
|
103 |
|
104 //----------------------------------------------------------------------------- |
|
105 // End of File |
|
106 //----------------------------------------------------------------------------- |