|
1 /* |
|
2 * Copyright (c) 2009 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 // It contains the client API. |
|
19 // It should not be modified manually. |
|
20 |
|
21 #ifndef LAYOUTPACK_CDL |
|
22 #define LAYOUTPACK_CDL |
|
23 |
|
24 #include <cdlengine.h> |
|
25 #include <layoutpack.cdl.common.h> |
|
26 |
|
27 namespace LayoutPack |
|
28 { |
|
29 |
|
30 class CInstance; |
|
31 |
|
32 // Standard interface functions |
|
33 inline void LoadCustomisationL(const TCdlRef& aRef) { CdlEngine::LoadCustomisationL(aRef); } |
|
34 inline void LoadCustomisationL(const TDesC& aLibName, TInt aInstId) { TCdlRef ref = { aInstId, { KCdlInterfaceUidValue }, &aLibName }; LoadCustomisationL(ref); } |
|
35 inline void RequireCustomisationL() { CdlEngine::RequireCustomisationL(&KCdlInterface); } |
|
36 inline TBool IsCustomisationStarted() { return CdlEngine::IsCustomisationStarted(&KCdlInterface); } |
|
37 inline const CInstance& CustomisationInstance() { return (const CInstance&)(CdlEngine::CustomisationInstance(KCdlInterfaceUid)); } |
|
38 inline void SetCustomisationChangeObserverL(MCdlChangeObserver* aObserver) { CdlEngine::SetCustomisationChangeObserverL(aObserver, KCdlInterfaceUid); } |
|
39 |
|
40 inline const TCdlRef& LastAccessedRef() { return CdlEngine::LastAccessedRef(KCdlInterfaceUid); } |
|
41 inline void FileNameRelativeToLastAccessedInstance(TFileName& aFileName) { CdlEngine::FileNameRelativeToLastAccessedInstance(KCdlInterfaceUid, aFileName); } |
|
42 |
|
43 |
|
44 // CDL API functions, as defined in layoutpack.cdl |
|
45 |
|
46 // |
|
47 // Primary layout identification data |
|
48 // |
|
49 // The name of this layout |
|
50 inline TDesC const& name() { return *(TDesC const*)(CdlEngine::GetData(KCdlInterfaceUid, EApiId_name)); } |
|
51 |
|
52 // Screen size that this layout works in |
|
53 inline TSize const& size() { return *(TSize const*)(CdlEngine::GetData(KCdlInterfaceUid, EApiId_size)); } |
|
54 |
|
55 // The type of layout, eg ELAF, ABRW, APAC |
|
56 inline TAknLayoutId const& id() { return *(TAknLayoutId const*)(CdlEngine::GetData(KCdlInterfaceUid, EApiId_id)); } |
|
57 |
|
58 // related layout instances |
|
59 inline TCdlArray<TCdlRef> const& contents() { return *(TCdlArray<TCdlRef> const*)(CdlEngine::GetData(KCdlInterfaceUid, EApiId_contents)); } |
|
60 |
|
61 // The zoom level that is present in this layout |
|
62 inline TAknUiZoom const& zoom() { return *(TAknUiZoom const*)(CdlEngine::GetData(KCdlInterfaceUid, EApiId_zoom)); } |
|
63 |
|
64 // A hash of the screen style name that this layout works in |
|
65 inline TInt const& styleHash() { return *(TInt const*)(CdlEngine::GetData(KCdlInterfaceUid, EApiId_styleHash)); } |
|
66 |
|
67 // the priority of this pack, instances in packs with the lowest priority will be added to the layout stack first |
|
68 inline TInt const& priority() { return *(TInt const*)(CdlEngine::GetData(KCdlInterfaceUid, EApiId_priority)); } |
|
69 |
|
70 // if this is non-zero, then this pack will only be loaded into an application whose Secure UID matches this |
|
71 inline TInt const& appUid() { return *(TInt const*)(CdlEngine::GetData(KCdlInterfaceUid, EApiId_appUid)); } |
|
72 |
|
73 |
|
74 |
|
75 class CInstance : public CCdlInstance |
|
76 { |
|
77 public: |
|
78 enum { ETypeId = KCdlInterfaceUidValue }; |
|
79 |
|
80 inline static const CInstance& CustomisationInstance() { return (const CInstance&)(CdlEngine::CustomisationInstance(KCdlInterfaceUid)); } |
|
81 inline static CInstance* NewL(const TCdlRef& aRef, const CCdlInstance* aSubLayer = NULL) { return (CInstance*) CCdlInstance::NewL(aRef, &KCdlInterface, aSubLayer); } |
|
82 inline static CInstance* NewLC(const TCdlRef& aRef, const CCdlInstance* aSubLayer = NULL) { return (CInstance*) CCdlInstance::NewLC(aRef, &KCdlInterface, aSubLayer); } |
|
83 inline static CInstance* NewL(const TDesC& aLibName, TInt aImplId, const CCdlInstance* aSubLayer = NULL) { TCdlRef ref = { aImplId, { KCdlInterfaceUidValue }, &aLibName }; return NewL(ref, aSubLayer); } |
|
84 inline static CInstance* NewLC(const TDesC& aLibName, TInt aImplId, const CCdlInstance* aSubLayer = NULL) { TCdlRef ref = { aImplId, { KCdlInterfaceUidValue }, &aLibName }; return NewLC(ref, aSubLayer); } |
|
85 |
|
86 inline const CInstance* SubLayer() { return static_cast<const CInstance*>(CCdlInstance::SubLayer()); } |
|
87 |
|
88 // CDL API functions, as defined in layoutpack.cdl |
|
89 |
|
90 // |
|
91 // Primary layout identification data |
|
92 // |
|
93 // The name of this layout |
|
94 inline TDesC const& name() const { return *(TDesC const*)(GetData(EApiId_name)); } |
|
95 |
|
96 // Screen size that this layout works in |
|
97 inline TSize const& size() const { return *(TSize const*)(GetData(EApiId_size)); } |
|
98 |
|
99 // The type of layout, eg ELAF, ABRW, APAC |
|
100 inline TAknLayoutId const& id() const { return *(TAknLayoutId const*)(GetData(EApiId_id)); } |
|
101 |
|
102 // related layout instances |
|
103 inline TCdlArray<TCdlRef> const& contents() const { return *(TCdlArray<TCdlRef> const*)(GetData(EApiId_contents)); } |
|
104 |
|
105 // The zoom level that is present in this layout |
|
106 inline TAknUiZoom const& zoom() const { return *(TAknUiZoom const*)(GetData(EApiId_zoom)); } |
|
107 |
|
108 // A hash of the screen style name that this layout works in |
|
109 inline TInt const& styleHash() const { return *(TInt const*)(GetData(EApiId_styleHash)); } |
|
110 |
|
111 // the priority of this pack, instances in packs with the lowest priority will be added to the layout stack first |
|
112 inline TInt const& priority() const { return *(TInt const*)(GetData(EApiId_priority)); } |
|
113 |
|
114 // if this is non-zero, then this pack will only be loaded into an application whose Secure UID matches this |
|
115 inline TInt const& appUid() const { return *(TInt const*)(GetData(EApiId_appUid)); } |
|
116 |
|
117 private: |
|
118 CInstance(); |
|
119 }; |
|
120 |
|
121 } // end of namespace LayoutPack |
|
122 #endif // LAYOUTPACK_CDL |