appfw/apparchitecture/apparc/apadoc.cpp
changeset 0 2e3d3ce01487
equal deleted inserted replaced
-1:000000000000 0:2e3d3ce01487
       
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // apadoc.cpp
       
    15 //
       
    16 
       
    17 #include <apadoc.h> // class CApaDocument and MApaEmbeddedDocObserver
       
    18 #include <apacln.h> // CleanupStack protection for CApaDocument
       
    19 #include "APASTD.H" // Panics etc.
       
    20 
       
    21 
       
    22 //
       
    23 // Doc cleanup method
       
    24 //
       
    25 
       
    26 EXPORT_C void TApaDocCleanupItem::DoCleanup(TAny* aPtr)
       
    27 	{
       
    28 	__ASSERT_ALWAYS(aPtr,Panic(EPanicNoCleanupItem));
       
    29 	TApaDocCleanupItem* cleanup = reinterpret_cast<TApaDocCleanupItem*>(aPtr);
       
    30 	__ASSERT_ALWAYS(cleanup->iApaProcess,Panic(EPanicNoCleanupItem));//lint !e613 Possible use of null pointer - Asserted above
       
    31 	cleanup->iApaProcess->DestroyDocument(cleanup->iApaDoc); //lint !e613 Possible use of null pointer - Asserted above
       
    32 	}
       
    33 
       
    34 
       
    35 //
       
    36 // CApaDocument
       
    37 //
       
    38 
       
    39 /** Constructor for CApaDocument */
       
    40 EXPORT_C CApaDocument::CApaDocument()
       
    41 	{
       
    42 	}
       
    43 
       
    44 EXPORT_C CApaDocument::CApaDocument(CApaApplication& aApp,CApaProcess& aProcess)
       
    45 	: iApplication(&aApp),
       
    46 	iApaProcess(&aProcess)
       
    47 /** Constructs the document object with the specified application and process.
       
    48 
       
    49 Derived classes must define and implement a constructor through which both 
       
    50 the associated application and process can be specified. A typical implementation 
       
    51 calls this constructor through a constructor initialization list.
       
    52 
       
    53 @param aApp The application.
       
    54 @param aProcess The process.
       
    55 @see CEikDocument */
       
    56 	{}
       
    57 
       
    58 
       
    59 EXPORT_C CApaDocument::~CApaDocument()
       
    60 /** Destructor.
       
    61 
       
    62 The implementation is empty. */
       
    63 	{
       
    64 	iContainer = NULL;
       
    65 	iApplication = NULL;
       
    66 	iApaProcess = NULL;
       
    67 	}
       
    68 
       
    69 
       
    70 EXPORT_C CApaDocument::TCapability CApaDocument::Capability() const
       
    71 /** Gets the document's capabilities.
       
    72 
       
    73 Capabilities are encapsulated by an instance of a TCapability class, a public 
       
    74 class defined inside this class.
       
    75 
       
    76 The default implementation returns a default TCapability object, indicating 
       
    77 that the document does not support any of the defined capabilities.
       
    78 
       
    79 If a document does support one or more of the capabilities, it should override 
       
    80 this function to return a suitably initialised object.
       
    81 
       
    82 @return The document's capabilities */
       
    83 	{
       
    84 	return TCapability();
       
    85 	}
       
    86 
       
    87 
       
    88 EXPORT_C void CApaDocument::ValidatePasswordL() const
       
    89 /** Checks the document password.
       
    90 
       
    91 The default implementation is empty.
       
    92 
       
    93 If a document is intended to be password protected, the UI application should 
       
    94 provide an implementation that forces the user to enter the password and validate 
       
    95 the input.
       
    96 
       
    97 If the document is protected by a password and the password entered by the 
       
    98 user is incorrect, the function should leave with KErrLocked, otherwise it 
       
    99 should just return. */
       
   100 	{}
       
   101 
       
   102 
       
   103 EXPORT_C CPicture* CApaDocument::GlassPictureL()
       
   104 // Return handle to glass picture, creating one if not already created.
       
   105 // returns NULL as glass pictures are not supported by default
       
   106 /** Gets an object that can draw a representation of the document's content.
       
   107 
       
   108 If the document supports being embedded as a glass door, then the UI application 
       
   109 must provide an implementation for this function.
       
   110 
       
   111 The default implementation raises an APPARC 8 panic.
       
   112 
       
   113 @return A pointer to a glass door. */
       
   114 	{
       
   115 	Panic(EPanicNoGlassDoorMethodSupplied);
       
   116 	//
       
   117 	return NULL;
       
   118 	}
       
   119 
       
   120 
       
   121 EXPORT_C void CApaDocument::ExternalizeL(RWriteStream& /*aStream*/)const
       
   122 	{}
       
   123 
       
   124 
       
   125 EXPORT_C void CApaDocument::OpenFileL(CFileStore*&, RFile&)
       
   126 	{
       
   127 	}
       
   128 
       
   129 EXPORT_C void CApaDocument::Reserved_2()
       
   130 	{}
       
   131 
       
   132 
       
   133 EXPORT_C CApaDocument::TCapability::TCapability()
       
   134 	:iCapability(0),TCapability_Reserved1(0)
       
   135 /** Constructs a default capability object.
       
   136 
       
   137 All capabilities are marked as "not supported". */
       
   138 	{}
       
   139 
       
   140 	
       
   141 //
       
   142 // MApaEmbeddedDocObserver
       
   143 //
       
   144 
       
   145 /** Constructor for MApaEmbeddedDocObserver */
       
   146 EXPORT_C MApaEmbeddedDocObserver::MApaEmbeddedDocObserver()
       
   147 	{
       
   148 	}
       
   149 
       
   150 /** Reserved for future use */
       
   151 EXPORT_C void MApaEmbeddedDocObserver::MApaEmbeddedDocObserver_Reserved1()
       
   152 	{
       
   153 	}
       
   154 
       
   155 /** Reserved for future use */
       
   156 EXPORT_C void MApaEmbeddedDocObserver::MApaEmbeddedDocObserver_Reserved2()
       
   157 	{
       
   158 	}
       
   159 
       
   160 
       
   161 
       
   162