notepad/notepad1/inc/NpdViewerLaf.h
changeset 0 f979ecb2b13e
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     1 /*
       
     2 * Copyright (c) 2002 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:  Declaration of Decoration graphics of Editor.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef NPDVIEWERLAF_H
       
    20 #define NPDVIEWERLAF_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <coecntrl.h>
       
    24 #include <AknUtils.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CAknIconArray;
       
    28 class TResourceReader;
       
    29 class CEikDialog;
       
    30 class RRegion;
       
    31 class CAknsFrameBackgroundControlContext;
       
    32 
       
    33 
       
    34 // CLASS DECLARATION
       
    35 /**
       
    36 * Control for decoration graphics of the editor.
       
    37 * CNotepadViewerLaf is a control for decoration graphics of Notepad Editor 
       
    38 * and Viewer.
       
    39 *  
       
    40 * @see CNotepadEditorLaf, CNotepadEditorDialog
       
    41 */
       
    42 class CNotepadViewerLaf : public CCoeControl
       
    43     {
       
    44     public: // Constuctor and destructor
       
    45 
       
    46         /**
       
    47         * Constructor.
       
    48         *
       
    49         * @param aParent parent dialog control.
       
    50         */
       
    51         CNotepadViewerLaf(CEikDialog* aParent);
       
    52 
       
    53         /**
       
    54         * Destructor.
       
    55         */
       
    56         virtual ~CNotepadViewerLaf();
       
    57 
       
    58     public: // New function
       
    59 
       
    60         /**
       
    61         * Set a decoration bitmap according to state of paging.
       
    62         *
       
    63         * @param aTopGap Height of invisible area above current edwin view.
       
    64         *     if 0 we are at top page of text and decoration bitmap should be
       
    65         *     'top', otherwize some invisible lines exist above current page 
       
    66         *     so the decoration should be 'cont'.
       
    67         */
       
    68         void SetImage( TBool aTopGap );
       
    69 
       
    70     protected: // New function
       
    71 
       
    72         /**
       
    73         * Attach rectangles for this control's shape and
       
    74         * Layout if need.
       
    75         *
       
    76         * @param aRect for layout.
       
    77         * @param aRegion for SetShape.
       
    78         */
       
    79         virtual void AddRectsAndLayout(const TRect& aRect, RRegion& aRegion);
       
    80 
       
    81     protected:  // Functions from base classes
       
    82 
       
    83         /**
       
    84         * From CCoeControl.
       
    85         * Construct this control from its resource.
       
    86         *
       
    87         * @param aReader resource reader already opened.
       
    88         */
       
    89         void ConstructFromResourceL(TResourceReader& aReader);
       
    90 
       
    91         /**
       
    92         * From CCoeControl.
       
    93         * Set Container control.
       
    94         *
       
    95         * @param aContainer container control.
       
    96         */
       
    97         void SetContainerWindowL(const CCoeControl& aContainer);
       
    98 
       
    99         /**
       
   100         * From CCoeControl.
       
   101         * Called when SizeChanged.
       
   102         */
       
   103         void SizeChanged();
       
   104 
       
   105         /**
       
   106         * From CCoeControl.
       
   107         * Draw.
       
   108         */
       
   109         void Draw(const TRect& aRect) const;
       
   110 
       
   111 		/**
       
   112         * From CCoeControl : Notifier for changing layout
       
   113         * @param aType : Type of resource change
       
   114         */
       
   115 		void HandleResourceChange(TInt aType);
       
   116 		TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
       
   117 
       
   118     private: // Data
       
   119 
       
   120         CFbsBitmap* iTopPageIcon;
       
   121         CFbsBitmap* iTopPageMask;
       
   122         CFbsBitmap* iMidPageIcon;
       
   123         CFbsBitmap* iMidPageMask;
       
   124         CFbsBitmap* iTopLeftCornerIcon;
       
   125         CFbsBitmap* iTopLeftCornerMask;
       
   126         CFbsBitmap* iTopRightCornerIcon;
       
   127         CFbsBitmap* iTopRightCornerMask;
       
   128 
       
   129         TBool iStartPage;
       
   130 
       
   131         CEikDialog* iParent; // not own
       
   132         TAknLayoutRect iBitmapLayout;
       
   133         TAknLayoutRect iTlCornerLayout;
       
   134         TAknLayoutRect iTrCornerLayout;
       
   135 		CAknsFrameBackgroundControlContext* iBgContext; // Owned
       
   136 		TBool iSkinUsed;
       
   137 
       
   138     };
       
   139 
       
   140 #endif // NPDVIEWERLAF_H
       
   141 
       
   142 // End of File