notepad/notepad1/inc/NpdExternalTextEditorDialog.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 Notepad Viewer Dialog class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef NPDEXTERNALTEXTEDITORDIALOG_H
       
    20 #define NPDEXTERNALTEXTEDITORDIALOG_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <eikapp.h>
       
    24 #include <eikdoc.h>
       
    25 #include <e32std.h>
       
    26 #include <coeccntx.h>
       
    27 #include <aknappui.h>
       
    28 #include <bldvariant.hrh>
       
    29 #include <charconv.h>
       
    30 #include "NpdDialogBase.h"
       
    31 #include <finditemengine.h>
       
    32 // FORWARD DECLARATIONS
       
    33 class CNotepadEdwin;
       
    34 class CEikDialog;
       
    35 class CSendUi;
       
    36 class CPlainText;
       
    37 class CFindItemMenu;
       
    38 
       
    39 // CLASS DECLARATION
       
    40 /**
       
    41 *  Dialog of viewer mode.
       
    42 *  CNotepadViewerDialog is a dialog for Notepad viewer.
       
    43 *  
       
    44 * @see CNotepadDialogBase
       
    45 */
       
    46 class CNotepadExternalTextDialog : public CNotepadDialogBase
       
    47     {
       
    48     public: // Constructor and destructor
       
    49 
       
    50         /**
       
    51         * Constructor.
       
    52         *
       
    53         * @param resource id of type STRUCT NOTEPAD_VIEWER_DIALOG
       
    54         * @param aSelfPtr pointer to pointer of this
       
    55         * @return Newly constructed CNotepadViewerDialog object.
       
    56         * @internal
       
    57         */
       
    58         IMPORT_C static CNotepadExternalTextDialog* NewL(
       
    59             HBufC** aText, 
       
    60             TInt& aReturnStatus,
       
    61             const TDesC& aInitialText, 
       
    62             const TDesC& aTitle, 
       
    63             const TDesC& aConfirmText, 
       
    64             CEikDialog** aSelfPtr );
       
    65 
       
    66         /**
       
    67         * Destructor.
       
    68         */
       
    69         IMPORT_C virtual ~CNotepadExternalTextDialog();
       
    70 
       
    71     protected:  // Functions from base classes
       
    72 
       
    73         /**
       
    74         * From CEikDialog.
       
    75         */
       
    76         TBool OkToExitL( TInt aButtonId ) ;
       
    77 
       
    78         /**
       
    79         * From CCoeControl
       
    80         *
       
    81         * @param aType event type.
       
    82         */
       
    83 		void HandleResourceChange(TInt aType);
       
    84 
       
    85         /**
       
    86         * From CCoeControl.
       
    87         * Called when SizeChanged.
       
    88         */
       
    89         void SizeChanged();
       
    90 
       
    91     private:  // Functions from base classes
       
    92 
       
    93         void ConstructL(
       
    94             TResourceReader& rr, 
       
    95             HBufC** aText,             
       
    96             TInt& aReturnStatus,
       
    97             const TDesC& aInitialText, 
       
    98             const TDesC& aTitle, 
       
    99             const TDesC& aConfirmText
       
   100             );
       
   101 
       
   102         /**
       
   103         * From CEikDialog.
       
   104         */
       
   105         void PostLayoutDynInitL();
       
   106 
       
   107         /**
       
   108         * From CCoeControl.
       
   109         */
       
   110         void ActivateL();
       
   111 
       
   112         /**
       
   113         * From CCoeControl
       
   114         *
       
   115         * @param aKeyEvent key event which includes ScanCode etc.
       
   116         * @param aType event type ( up, in, down...).
       
   117         */
       
   118         TKeyResponse OfferKeyEventL(
       
   119             const TKeyEvent& aKeyEvent, 
       
   120             TEventCode aType);
       
   121 
       
   122         /**
       
   123         * From CCoeControl.
       
   124         *
       
   125         * @param aContext TCoeHelpContext.
       
   126         */
       
   127         void GetHelpContext(TCoeHelpContext& aContext) const;
       
   128 
       
   129         /**
       
   130         * From MEikCommandObserver
       
   131         * 
       
   132         * @param aCommandId command.
       
   133         */
       
   134         void ProcessCommandL(TInt aCommandId);
       
   135 
       
   136         /**
       
   137         * From MEikMenuObserver.
       
   138         * 
       
   139         * @param aResourceId resource id.
       
   140         * @param menu pane object.
       
   141         */
       
   142         void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
       
   143         
       
   144         
       
   145          /**
       
   146         * From MEikMenuObserver.
       
   147         * 
       
   148         * @param aResourceId resource id.
       
   149         * @param menu pane object.
       
   150         */
       
   151         void DynInitMenuBarL(TInt aResourceId, CEikMenuBar* aMenuBar);
       
   152 
       
   153 
       
   154 		/**
       
   155 		* Changes for Find Item.
       
   156 		* To search a given buffer for phone numbers, email ids, URLs.
       
   157 		**/
       
   158 		TInt DoSearchL(CFindItemEngine::TFindItemSearchCase aCase);
       
   159     private: // Data
       
   160 
       
   161         enum TNotepadViewerFlags
       
   162             {
       
   163             ENotepadMenuByOkKey = 0x02
       
   164             };
       
   165            
       
   166         CNotepadEdwin* iEditor; // not own (dialog own)
       
   167         HBufC** iContentPointer; // not owned (calling app owns)
       
   168         TPtrC iContent;
       
   169         TPtrC iDeleteConfirmation;
       
   170         TInt* iReturnValue;
       
   171         TInt iStatus;
       
   172         TBool iOKKeyPressed; 
       
   173 		CFindItemMenu*  iFindItemMenu; //own
       
   174     };
       
   175 
       
   176 #endif // NPDEXTERNALTEXTEDITORDIALOG_H
       
   177 
       
   178 // End of File