notepad/notepad1/LibSrc/NpdEdwin.cpp
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:  Implementation of Notepad/Template Editor.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "NpdEdwin.h"
       
    20 #include "NpdEdwinBase.h"
       
    21 
       
    22 // ============================ MEMBER FUNCTIONS ===============================
       
    23 
       
    24 // -----------------------------------------------------------------------------
       
    25 // CNotepadEdwin::DoEditorLayoutL
       
    26 // Sets the layout of the Edwin and the scrollbar.
       
    27 // -----------------------------------------------------------------------------
       
    28 //
       
    29 void CNotepadEdwin::DoEditorLayoutL()
       
    30     {
       
    31     iEdwinBase->DoEditorLayoutL();
       
    32     }
       
    33 
       
    34 // -----------------------------------------------------------------------------
       
    35 // CNotepadEdwin::InitNotepadEditorL
       
    36 // -----------------------------------------------------------------------------
       
    37 //
       
    38 void CNotepadEdwin::InitNotepadEditorL(
       
    39     CEikDialog* aParent,
       
    40     CNotepadEdwinLines* aEdwinLines)
       
    41     {
       
    42     iEdwinBase->InitNotepadEditorL(aParent,EFalse,aEdwinLines);
       
    43     }
       
    44 
       
    45 // -----------------------------------------------------------------------------
       
    46 // CNotepadRichTextEditor::InitNotepadEditorL
       
    47 // -----------------------------------------------------------------------------
       
    48 //
       
    49 void CNotepadEdwin::ConstructBaseL()
       
    50     {
       
    51     iEdwinBase = new (ELeave) CNotepadEdwinBase();
       
    52     iEdwinBase->Share(this,this);	
       
    53     }
       
    54     
       
    55 // -----------------------------------------------------------------------------
       
    56 // CNotepadEdwin::SetBackgroundColorL
       
    57 // -----------------------------------------------------------------------------
       
    58 //
       
    59 void CNotepadEdwin::SetBackgroundColorL()
       
    60     {
       
    61     iEdwinBase->SetBackgroundColorL();
       
    62     }
       
    63 
       
    64 // -----------------------------------------------------------------------------
       
    65 // CNotepadEdwin::HandleResourceChange
       
    66 // from CCoeControl
       
    67 // -----------------------------------------------------------------------------
       
    68 //
       
    69 void CNotepadEdwin::HandleResourceChange( TInt aType )
       
    70     {
       
    71     if ( iEdwinBase )
       
    72     	{
       
    73         iEdwinBase->HandleResourceChange( aType );
       
    74     	}
       
    75     }
       
    76 
       
    77 // -----------------------------------------------------------------------------
       
    78 // CNotepadEdwin::Draw
       
    79 // from CCoeControl
       
    80 // -----------------------------------------------------------------------------
       
    81 //
       
    82 void CNotepadEdwin::Draw(const TRect& aRect) const   
       
    83     {
       
    84     iEdwinBase->Draw(aRect);
       
    85     }
       
    86 
       
    87 // ---------------------------------------------------------
       
    88 // CNotepadEdwin::MopSupplyObject(TTypeUid aId)
       
    89 // Gets an object whose type is encapsulated by 
       
    90 // the specified TTypeUid object.
       
    91 // ---------------------------------------------------------
       
    92 //
       
    93 TTypeUid::Ptr CNotepadEdwin::MopSupplyObject(TTypeUid aId)
       
    94 	{
       
    95 	TTypeUid::Ptr ptr = TTypeUid::Null();
       
    96 	if(iEdwinBase->SupplyMopObject(aId,ptr))
       
    97 		{
       
    98 			return ptr;
       
    99 		}
       
   100 		//return CCoeControl::MopSupplyObject(aId);
       
   101 		return CEikEdwin::MopSupplyObject(aId);
       
   102 	}
       
   103 
       
   104 // ---------------------------------------------------------
       
   105 // CNotepadEdwin::~CNotepadEdwin()
       
   106 // Destructor
       
   107 // ---------------------------------------------------------
       
   108 //
       
   109 CNotepadEdwin::~CNotepadEdwin()
       
   110 	{
       
   111 	delete iEdwinBase;
       
   112 	}
       
   113 
       
   114 // ---------------------------------------------------------
       
   115 // CNotepadEdwin::GetLayout()
       
   116 // returns reference to iLayout
       
   117 // ---------------------------------------------------------
       
   118 //
       
   119 
       
   120 CTextLayout& CNotepadEdwin::GetLayout()
       
   121 	{
       
   122 	return *iLayout;
       
   123 	}
       
   124 
       
   125 // ---------------------------------------------------------
       
   126 // CNotepadEdwin::GetLayout()
       
   127 // returns reference to iTextView
       
   128 // ---------------------------------------------------------
       
   129 //
       
   130 CTextView& CNotepadEdwin::GetTextView()
       
   131 	{
       
   132 	return *iTextView;	
       
   133 	}
       
   134 
       
   135 // ---------------------------------------------------------
       
   136 // CNotepadEdwin::GetLayout()
       
   137 // Calls SetCanDrawOusideRect()
       
   138 // ---------------------------------------------------------
       
   139 //
       
   140 void CNotepadEdwin::CallSetCanDrawOutsideRect()
       
   141 	{
       
   142 	SetCanDrawOutsideRect();
       
   143 	}
       
   144 
       
   145 // ---------------------------------------------------------
       
   146 // CNotepadEdwin::GetLayout()
       
   147 // returns reference to iCoeEnv
       
   148 // ---------------------------------------------------------
       
   149 //
       
   150 
       
   151 CCoeEnv& CNotepadEdwin::GetCoeEnv()
       
   152 	{
       
   153 	return *iCoeEnv;
       
   154 	}
       
   155 // End of File