|
1 /******************************************************************************* |
|
2 * Copyright (c) 2005, 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. This program and the accompanying materials |
|
4 * are made available under the terms of the Eclipse Public License v1.0 |
|
5 * which accompanies this distribution, and is available at |
|
6 * http://www.eclipse.org/legal/epl-v10.html |
|
7 * |
|
8 * Contributors: |
|
9 * Nokia Corporation - S60 implementation |
|
10 *******************************************************************************/ |
|
11 |
|
12 |
|
13 #ifndef SWTGRPALETTEDATA_H |
|
14 #define SWTGRPALETTEDATA_H |
|
15 |
|
16 |
|
17 #include "eswtgraphics.h" |
|
18 |
|
19 |
|
20 /** |
|
21 * CSwtGrPaletteData |
|
22 * @lib eswt |
|
23 */ |
|
24 NONSHARABLE_CLASS(CSwtGrPaletteData) |
|
25 : public CBase |
|
26 , public MSwtPaletteData |
|
27 { |
|
28 // Methods |
|
29 public: |
|
30 static CSwtGrPaletteData* NewL(TBool aDirect); |
|
31 ~CSwtGrPaletteData(); |
|
32 void SetIndirectData(CPalette* aColors); |
|
33 void SetDirectData(const TDirectData& aData); |
|
34 private: |
|
35 inline CSwtGrPaletteData(TBool aDirect); |
|
36 |
|
37 // From MSwtPaletteData |
|
38 public: |
|
39 TBool IsDirect() const; |
|
40 const TDirectData& DirectData() const; |
|
41 const CPalette* IndirectData() const; |
|
42 |
|
43 // Data types |
|
44 private: |
|
45 union TData |
|
46 { |
|
47 TDirectData iDirect; // The direct palette information |
|
48 CPalette* iColors; // The indirect palette information |
|
49 }; |
|
50 |
|
51 // Data |
|
52 private: |
|
53 TBool iIsDirect; // ETrue for a direct palette, EFalse otherwise. |
|
54 TData iData; // The palette data |
|
55 }; |
|
56 |
|
57 |
|
58 #endif // SWTGRPALETTEDATA_H |