2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * A default control in the status pane's context pane.
24 #include <AknControl.h>
27 class CAknContextPaneExtension;
30 * A default control in the status pane's context pane.
32 class CAknContextPane : public CAknControl
36 DECLARE_TYPE_ID(0x101F8741)
41 * Standard constructor
43 IMPORT_C CAknContextPane();
48 IMPORT_C ~CAknContextPane();
51 * 2nd phase construction
54 IMPORT_C void ConstructL();
57 * Construct from resources.
58 * @param aReader resource reader.
60 IMPORT_C void ConstructFromResourceL(TResourceReader& aReader);
63 * Sets bitmap with mask to the context pane and shows it in the status pane's
64 * context pane. Context pane object takes ownership of the bitmap.
65 * @param aBitmap new bitmap to the context pane.
66 * @param aMaskBitmap mask of the bitmap.
68 IMPORT_C void SetPicture(const CFbsBitmap* aBitmap,
69 const CFbsBitmap* aMaskBitmap = NULL);
72 * Sets bitmap to the context pane and shows it in the status pane's
73 * context pane. Context pane object takes ownership of the bitmap.
74 * @param aImage new bitmap and its mask.
76 IMPORT_C void SetPicture(CEikImage* aImage);
79 * Sets bitmap to the context pane from file and shows it in the status pane's
81 * @param aFileName name of the bitmap file.
82 * @param aMainId id of the bitmap in the bitmap file.
83 * @param aMaskId id of the bitmap's mask in the bitmap file.
85 IMPORT_C void SetPictureFromFileL(const TDesC& aFileName,
86 TInt aMainId, TInt aMaskId = -1);
89 * Set data from resource file and show it in the status pane's context pane.
91 IMPORT_C void SetFromResourceL(TResourceReader& aReader);
94 * Show context pane's default bitmap. Application's AIF file icon is used if it exists.
96 IMPORT_C void SetPictureToDefaultL();
99 * Returns a reference to the current context pane bitmap. The reference is lost when
100 * context pane bitmap is changed with any Set -method including
101 * SetPictureToDefaultL and SwapPicture)
102 * @return Reference to the current context pane bitmap.
104 IMPORT_C const CEikImage& Picture() const;
107 * Sets bitmap with mask to the context pane and shows it in the status pane's
108 * context pane. Context pane object takes ownership of the bitmap.
109 * Old bitmap is returned and the caller is responsible of deleting the returned object.
110 * @param aNewImage new bitmap to the context pane. This object takes ownership of aNewImage.
111 * @return Previous context pane bitmap. The caller is responsible of deleting the returned object.
113 IMPORT_C CEikImage* SwapPicture(CEikImage* aNewImage);
116 * Set the background type. This method is used by the UI framework for
117 * for syncronizing this components background type with navipane
120 * Available backgroud types are:
121 * EAknNaviPaneBackgroundTypeNotDefined
122 * EAknNaviPaneBackgroundTypeWipe
123 * EAknNaviPaneBackgroundTypeSolid
125 * @param aType Background type.
127 void SetNaviPaneBackgroundType(TInt aType);
131 * Handles pointer events
133 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
135 protected: // from CCoeControl
138 * From CCoeControl. Handle the size change events.
140 IMPORT_C virtual void SizeChanged();
143 * Handles a change to the control's resources of type aType
144 * which are shared across the environment, e.g. color scheme change.
145 * @param aType Event type.
147 IMPORT_C virtual void HandleResourceChange(TInt aType);
150 * From CCoeControl. Returns number of controls inside the context pane control.
151 * @return Number of component controls.
153 IMPORT_C virtual TInt CountComponentControls() const;
156 * From CCoeControl. Returns a control determined by control id.
157 * @param anIndex Index of a control to be returned.
158 * @return Pointer to control
160 IMPORT_C virtual CCoeControl* ComponentControl(TInt aIndex) const;
162 private: // new functions
163 void CommonConstructL();
166 * Returns application's Uid. In embedded applications, root application's Uid is returned.
167 * @return Application's Uid. Root application's Uid is returned in embedded applications.
170 void ReadFromResourceFileL(TResourceReader& aReader);
171 void LoadNaviWipeBitmapL();
173 void SetPictureSize(CFbsBitmap* aPicture, TSize aSize);
175 private: // From CCoeControl
176 IMPORT_C virtual void Draw(const TRect& aRect) const;
182 IMPORT_C void* ExtensionInterface( TUid aInterface );
186 TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
189 CAknContextPaneExtension* iExtension;
193 #endif // AKNCONTEXT_H