83
|
1 |
/*
|
|
2 |
* Copyright (c) 2005-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: Touch Toolbar
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef C_AITOOLBARRENDERER_H
|
|
20 |
#define C_AITOOLBARRENDERER_H
|
|
21 |
|
|
22 |
// System includes
|
|
23 |
#include <e32std.h>
|
|
24 |
#include <akntoolbarobserver.h>
|
|
25 |
|
|
26 |
// User includes
|
|
27 |
#include "ainativerenderer.h"
|
|
28 |
#include "ainativeuimodel.h"
|
|
29 |
#include "aitoolbarbutton.h"
|
|
30 |
|
|
31 |
// Forward declarations
|
|
32 |
class CHsContentPublisher;
|
|
33 |
class MAiFwEventHandler;
|
|
34 |
class CAknToolbar;
|
|
35 |
|
|
36 |
namespace AiNativeUiController
|
|
37 |
{
|
|
38 |
/**
|
|
39 |
* Toolbar class of Native UI Controller application
|
|
40 |
*
|
|
41 |
* @lib AiNatiUi
|
|
42 |
*/
|
|
43 |
// inheritance order must be this, despite codescanner warnings
|
|
44 |
NONSHARABLE_CLASS( CAiToolbarRenderer ) : public MAknToolbarObserver,
|
|
45 |
public CAiNativeRenderer
|
|
46 |
{
|
|
47 |
public: // Constructors and destructor
|
|
48 |
|
|
49 |
static CAiToolbarRenderer* NewLC( MAiFwEventHandler& aAiFwEventHandler, CAknToolbar& aToolbar);
|
|
50 |
|
|
51 |
static CAiToolbarRenderer* NewL( MAiFwEventHandler& aAiFwEventHandler, CAknToolbar& aToolbar );
|
|
52 |
|
|
53 |
~CAiToolbarRenderer();
|
|
54 |
|
|
55 |
public: // from CAiNativeRenderer
|
|
56 |
|
|
57 |
void DoPublishL( CHsContentPublisher& aPlugin,
|
|
58 |
TInt aContent,
|
|
59 |
const TDesC16& aText,
|
|
60 |
TInt aIndex );
|
|
61 |
|
|
62 |
void DoPublishL( CHsContentPublisher& aPlugin,
|
|
63 |
TInt aContent,
|
|
64 |
const TDesC8& aBuf,
|
|
65 |
TInt aIndex );
|
|
66 |
|
|
67 |
void TransactionCommittedL();
|
|
68 |
|
|
69 |
|
|
70 |
private: // from MAknToolbarObserver
|
|
71 |
|
|
72 |
void DynInitToolbarL( TInt aResourceId, CAknToolbar* aToolbar );
|
|
73 |
|
|
74 |
void OfferToolbarEventL( TInt aCommand );
|
|
75 |
|
|
76 |
private:
|
|
77 |
|
|
78 |
CAiToolbarRenderer( MAiFwEventHandler& aAiFwEventHandler, CAknToolbar& aToolbar );
|
|
79 |
|
|
80 |
void ConstructL();
|
|
81 |
|
|
82 |
|
|
83 |
/**
|
|
84 |
* Get a button with id. If no button exists at the given
|
|
85 |
* id a new button will be created and returned.
|
|
86 |
*
|
|
87 |
* Ownership NOT transferred.
|
|
88 |
*/
|
|
89 |
CAiToolbarButton* ButtonL( TInt aShortcutId );
|
|
90 |
|
|
91 |
|
|
92 |
private: // Data
|
|
93 |
|
|
94 |
/**
|
|
95 |
* The actual toolbar
|
|
96 |
*/
|
|
97 |
CAknToolbar& iToolbar;
|
|
98 |
|
|
99 |
/**
|
|
100 |
* Handler to send the toolbar events
|
|
101 |
*/
|
|
102 |
MAiFwEventHandler& iAiFwEventHandler;
|
|
103 |
|
|
104 |
/**
|
|
105 |
* Array of buttons. Buttons are owned.
|
|
106 |
*/
|
|
107 |
RPointerArray<CAiToolbarButton> iButtons;
|
|
108 |
|
|
109 |
/**
|
|
110 |
* Have we already committed
|
|
111 |
*/
|
|
112 |
TBool iCommitted;
|
|
113 |
|
|
114 |
/**
|
|
115 |
* Is the toolbar enabled in the cenrep
|
|
116 |
*/
|
|
117 |
TBool iToolbarEnabled;
|
|
118 |
};
|
|
119 |
|
|
120 |
} // namespace AiNativeUiController
|
|
121 |
|
|
122 |
#endif // C_AITOOLBARRENDERER_H
|
|
123 |
|
|
124 |
// End of File.
|