|
1 /* |
|
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Flag container class definition. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef T_VTFLAGCONTAINER_H |
|
20 #define T_VTFLAGCONTAINER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 /** |
|
25 * TVtFlagContainer |
|
26 * |
|
27 * Flag container is a class that holds maximum of 32 different flags. Also |
|
28 * contains methods for setting, clearing and getting the flag state. |
|
29 * |
|
30 * @since S60 v3.2 |
|
31 */ |
|
32 NONSHARABLE_CLASS( TVtFlagContainer ) |
|
33 { |
|
34 public: |
|
35 |
|
36 /** |
|
37 * Constructor. |
|
38 */ |
|
39 inline TVtFlagContainer(); |
|
40 |
|
41 protected: |
|
42 |
|
43 /** |
|
44 * Clears all flags. |
|
45 */ |
|
46 inline void Clear(); |
|
47 |
|
48 /** |
|
49 * Tests flag. |
|
50 */ |
|
51 inline TBool IsFlag( TUint32 aFlags ) const; |
|
52 |
|
53 /** |
|
54 * Sets flag(s). |
|
55 */ |
|
56 inline void SetFlag( TUint32 aFlags ); |
|
57 |
|
58 /** |
|
59 * Clears flag(s). |
|
60 */ |
|
61 inline void ClearFlag( TUint32 aFlags ); |
|
62 |
|
63 /** |
|
64 * Gets flag value. |
|
65 */ |
|
66 inline TUint32 Value() const; |
|
67 |
|
68 /** |
|
69 * Sets flag value. |
|
70 */ |
|
71 inline void SetValue( TUint32 aValue ); |
|
72 |
|
73 private: |
|
74 |
|
75 // Current flags |
|
76 TUint32 iFlags; |
|
77 |
|
78 }; |
|
79 |
|
80 /** |
|
81 * TVtUpdateableFlagContainer |
|
82 * |
|
83 * A flag container with Update() method that can be called to get |
|
84 * flags updated in one pass. |
|
85 * |
|
86 * @since S60 v3.2 |
|
87 */ |
|
88 NONSHARABLE_CLASS( TVtUpdateableFlagContainer ) : public TVtFlagContainer |
|
89 { |
|
90 public: |
|
91 |
|
92 /** |
|
93 * Issues flag updation. |
|
94 */ |
|
95 inline void Update(); |
|
96 |
|
97 private: |
|
98 |
|
99 /** |
|
100 * Called when flags needs to be updated (as a result to call Update()). |
|
101 */ |
|
102 virtual void UpdateFlags() = 0; |
|
103 |
|
104 }; |
|
105 |
|
106 #include "tvtflagcontainer.inl" |
|
107 |
|
108 #endif // T_VTFLAGCONTAINER_H |