epoc32/include/mw/akncontext.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@2
     5
* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
williamr@2
     6
* which accompanies this distribution, and is available
williamr@2
     7
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description: 
williamr@2
    15
*     A default control in the status pane's context pane.
williamr@2
    16
*     
williamr@2
    17
*
williamr@2
    18
*/
williamr@2
    19
williamr@2
    20
williamr@2
    21
#ifndef AKNCONTEXT_H
williamr@2
    22
#define AKNCONTEXT_H
williamr@2
    23
williamr@2
    24
#include <AknControl.h>
williamr@2
    25
williamr@2
    26
class CEikImage;
williamr@2
    27
class CAknContextPaneExtension;
williamr@2
    28
williamr@2
    29
/**
williamr@2
    30
 * A default control in the status pane's context pane.
williamr@2
    31
 */
williamr@2
    32
class CAknContextPane : public CAknControl
williamr@2
    33
	{
williamr@2
    34
public:
williamr@2
    35
williamr@2
    36
    DECLARE_TYPE_ID(0x101F8741) 
williamr@2
    37
williamr@2
    38
public:
williamr@2
    39
    
williamr@2
    40
    /**
williamr@2
    41
    * Standard constructor
williamr@2
    42
    */
williamr@2
    43
    IMPORT_C CAknContextPane();
williamr@2
    44
    
williamr@2
    45
    /**
williamr@2
    46
    * Destructor
williamr@2
    47
    */
williamr@2
    48
    IMPORT_C ~CAknContextPane();
williamr@2
    49
    
williamr@2
    50
    /** 
williamr@2
    51
    * 2nd phase construction
williamr@2
    52
    *
williamr@2
    53
    */
williamr@2
    54
    IMPORT_C void ConstructL();
williamr@2
    55
    
williamr@2
    56
    /** 
williamr@2
    57
    * Construct from resources.
williamr@2
    58
    * @param aReader resource reader.
williamr@2
    59
    */
williamr@2
    60
    IMPORT_C void ConstructFromResourceL(TResourceReader& aReader);
williamr@2
    61
    
williamr@2
    62
    /**
williamr@2
    63
    * Sets bitmap with mask to the context pane and shows it in the status pane's 
williamr@2
    64
    * context pane. Context pane object takes ownership of the bitmap.
williamr@2
    65
    * @param aBitmap new bitmap to the context pane.
williamr@2
    66
    * @param aMaskBitmap mask of the bitmap.
williamr@2
    67
    */
williamr@2
    68
    IMPORT_C void SetPicture(const CFbsBitmap* aBitmap, 
williamr@2
    69
        const CFbsBitmap* aMaskBitmap = NULL);
williamr@2
    70
    
williamr@2
    71
    /**
williamr@2
    72
    * Sets bitmap to the context pane and shows it in the status pane's 
williamr@2
    73
    * context pane. Context pane object takes ownership of the bitmap.
williamr@2
    74
    * @param aImage new bitmap and its mask.
williamr@2
    75
    */
williamr@2
    76
    IMPORT_C void SetPicture(CEikImage* aImage);
williamr@2
    77
    
williamr@2
    78
    /**
williamr@2
    79
    * Sets bitmap to the context pane from file and shows it in the status pane's 
williamr@2
    80
    * context pane.
williamr@2
    81
    * @param aFileName name of the bitmap file.
williamr@2
    82
    * @param aMainId id of the bitmap in the bitmap file.
williamr@2
    83
    * @param aMaskId id of the bitmap's mask in the bitmap file.
williamr@2
    84
    */
williamr@2
    85
    IMPORT_C void SetPictureFromFileL(const TDesC& aFileName, 
williamr@2
    86
                                                               TInt aMainId, TInt aMaskId = -1);
williamr@2
    87
    
williamr@2
    88
    /**
williamr@2
    89
    * Set data from resource file and show it in the status pane's context pane.
williamr@2
    90
    */
williamr@2
    91
    IMPORT_C void SetFromResourceL(TResourceReader& aReader);
williamr@2
    92
    
williamr@2
    93
    /**
williamr@2
    94
    * Show context pane's default bitmap. Application's AIF file icon is used if it exists.
williamr@2
    95
    */
williamr@2
    96
    IMPORT_C void SetPictureToDefaultL();
williamr@2
    97
    
williamr@2
    98
    /**
williamr@2
    99
    * Returns a reference to the current context pane bitmap. The reference is lost when
williamr@2
   100
    * context pane bitmap is changed with any Set -method including 
williamr@2
   101
    * SetPictureToDefaultL and SwapPicture)
williamr@2
   102
    * @return Reference to the current context pane bitmap.
williamr@2
   103
    */
williamr@2
   104
    IMPORT_C const CEikImage& Picture() const;
williamr@2
   105
    
williamr@2
   106
    /**
williamr@2
   107
    * Sets bitmap with mask to the context pane and shows it in the status pane's 
williamr@2
   108
    * context pane. Context pane object takes ownership of the bitmap.
williamr@2
   109
    * Old bitmap is returned and the caller is responsible of deleting the returned object.
williamr@2
   110
    * @param aNewImage new bitmap to the context pane. This object takes ownership of aNewImage.
williamr@2
   111
    * @return Previous context pane bitmap. The caller is responsible of deleting the returned object.
williamr@2
   112
    */
williamr@2
   113
    IMPORT_C CEikImage* SwapPicture(CEikImage* aNewImage);
williamr@2
   114
williamr@2
   115
    /** 
williamr@2
   116
    * Set the background type. This method is used by the UI framework for 
williamr@2
   117
    * for syncronizing this components background type with navipane 
williamr@2
   118
    * background type.
williamr@2
   119
    * 
williamr@2
   120
    * Available backgroud types are:
williamr@2
   121
    *      EAknNaviPaneBackgroundTypeNotDefined  
williamr@2
   122
    *      EAknNaviPaneBackgroundTypeWipe        
williamr@2
   123
    *      EAknNaviPaneBackgroundTypeSolid       
williamr@2
   124
    *
williamr@2
   125
    * @param aType Background type.
williamr@2
   126
    */
williamr@2
   127
    void SetNaviPaneBackgroundType(TInt aType);
williamr@2
   128
williamr@2
   129
    /**
williamr@2
   130
     * From CCoeControl.     
williamr@2
   131
     * Handles pointer events
williamr@2
   132
     */
williamr@2
   133
    IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
williamr@2
   134
    
williamr@2
   135
protected: // from CCoeControl
williamr@2
   136
williamr@2
   137
    /**
williamr@2
   138
    * From CCoeControl. Handle the size change events.
williamr@2
   139
    */
williamr@2
   140
    IMPORT_C virtual void SizeChanged();
williamr@2
   141
williamr@2
   142
    /**
williamr@2
   143
	 * Handles a change to the control's resources of type aType
williamr@2
   144
	 * which are shared across the environment, e.g. color scheme change.
williamr@2
   145
	 * @param aType Event type.
williamr@2
   146
	 */
williamr@2
   147
    IMPORT_C virtual void HandleResourceChange(TInt aType);
williamr@2
   148
williamr@2
   149
    /**
williamr@2
   150
    * From CCoeControl. Returns number of controls inside the context pane control.
williamr@2
   151
    * @return Number of component controls.
williamr@2
   152
    */
williamr@2
   153
    IMPORT_C virtual TInt CountComponentControls() const;
williamr@2
   154
williamr@2
   155
    /**
williamr@2
   156
    * From CCoeControl. Returns a control determined by control id.
williamr@2
   157
    * @param anIndex Index of a control to be returned.
williamr@2
   158
    * @return Pointer to control
williamr@2
   159
    */
williamr@2
   160
    IMPORT_C virtual CCoeControl* ComponentControl(TInt aIndex) const;
williamr@2
   161
williamr@2
   162
private: // new functions
williamr@2
   163
    void CommonConstructL();
williamr@2
   164
    
williamr@2
   165
    /** 
williamr@2
   166
    * Returns application's Uid. In embedded applications, root application's Uid is returned.
williamr@2
   167
    * @return Application's Uid. Root application's Uid is returned in embedded applications.
williamr@2
   168
    */
williamr@2
   169
    TUid AppUid();
williamr@2
   170
    void ReadFromResourceFileL(TResourceReader& aReader);
williamr@2
   171
    void LoadNaviWipeBitmapL();
williamr@2
   172
    void InitL();
williamr@2
   173
    void SetPictureSize(CFbsBitmap* aPicture, TSize aSize);
williamr@2
   174
williamr@2
   175
private: // From CCoeControl
williamr@2
   176
    IMPORT_C virtual void Draw(const TRect& aRect) const;
williamr@2
   177
williamr@2
   178
private:
williamr@2
   179
    /**
williamr@2
   180
    * From CAknControl
williamr@2
   181
    */
williamr@2
   182
    IMPORT_C void* ExtensionInterface( TUid aInterface );
williamr@2
   183
williamr@2
   184
protected:
williamr@2
   185
    // from CCoeControl
williamr@2
   186
    TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
williamr@2
   187
williamr@2
   188
private:
williamr@2
   189
    CAknContextPaneExtension* iExtension;
williamr@2
   190
	};
williamr@2
   191
williamr@2
   192
williamr@2
   193
#endif // AKNCONTEXT_H