|
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 DISPLAYLAYOUTMETRICS_CDL |
|
22 #define DISPLAYLAYOUTMETRICS_CDL |
|
23 |
|
24 #include <cdlengine.h> |
|
25 #include <displaylayoutmetrics.cdl.common.h> |
|
26 |
|
27 namespace Display_Layout_Metrics |
|
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 displaylayoutmetrics.cdl |
|
45 |
|
46 inline TReal32 UnitValue() { return (*(TUnitValue_sig*)(CdlEngine::GetFunction(KCdlInterfaceUid, EApiId_UnitValue)))(); } |
|
47 |
|
48 |
|
49 |
|
50 class CInstance : public CCdlInstance |
|
51 { |
|
52 public: |
|
53 enum { ETypeId = KCdlInterfaceUidValue }; |
|
54 |
|
55 inline static const CInstance& CustomisationInstance() { return (const CInstance&)(CdlEngine::CustomisationInstance(KCdlInterfaceUid)); } |
|
56 inline static CInstance* NewL(const TCdlRef& aRef, const CCdlInstance* aSubLayer = NULL) { return (CInstance*) CCdlInstance::NewL(aRef, &KCdlInterface, aSubLayer); } |
|
57 inline static CInstance* NewLC(const TCdlRef& aRef, const CCdlInstance* aSubLayer = NULL) { return (CInstance*) CCdlInstance::NewLC(aRef, &KCdlInterface, aSubLayer); } |
|
58 inline static CInstance* NewL(const TDesC& aLibName, TInt aImplId, const CCdlInstance* aSubLayer = NULL) { TCdlRef ref = { aImplId, { KCdlInterfaceUidValue }, &aLibName }; return NewL(ref, aSubLayer); } |
|
59 inline static CInstance* NewLC(const TDesC& aLibName, TInt aImplId, const CCdlInstance* aSubLayer = NULL) { TCdlRef ref = { aImplId, { KCdlInterfaceUidValue }, &aLibName }; return NewLC(ref, aSubLayer); } |
|
60 |
|
61 inline const CInstance* SubLayer() { return static_cast<const CInstance*>(CCdlInstance::SubLayer()); } |
|
62 |
|
63 // CDL API functions, as defined in displaylayoutmetrics.cdl |
|
64 |
|
65 inline TReal32 UnitValue() const { return (*(TUnitValue_sig*)(GetFunction(EApiId_UnitValue)))(); } |
|
66 |
|
67 private: |
|
68 CInstance(); |
|
69 }; |
|
70 |
|
71 } // end of namespace Display_Layout_Metrics |
|
72 #endif // DISPLAYLAYOUTMETRICS_CDL |