00001 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). 00002 // All rights reserved. 00003 // This component and the accompanying materials are made available 00004 // under the terms of "Eclipse Public License v1.0" 00005 // which accompanies this distribution, and is available 00006 // at the URL "http://www.eclipse.org/legal/epl-v10.html". 00007 // 00008 // Initial Contributors: 00009 // Nokia Corporation - initial contribution. 00010 // 00011 // Contributors: 00012 // 00013 // Description: 00014 // Header file demonstrating Extension DLL pattern 00015 // This is the header file declaring the CNumberStore class. 00016 // This file contains both the original functions and also the functions added by 00017 // the extension. Therefore this file is modified by the extender of the API. 00018 // This is v2 of the header, and includes some new functions added by the supplier to 00019 // demonstrate the def file being disrupted. 00020 // 00021 00022 #if !defined(__NUMBERSTORE_V2__) 00023 #define __NUMBERSTORE_V2__ 00024 00025 #include <e32std.h> 00026 #include <e32base.h> 00027 00028 /* class CNumberStore 00029 A trivial class to own two numbers */ 00030 class CNumberStore : public CBase 00031 { 00032 public: //functions 00033 00034 // Original functions contained in dll from supplier 00035 IMPORT_C CNumberStore (); 00036 IMPORT_C CNumberStore (TInt aNumber1, TInt aNumber2); 00037 IMPORT_C void SetNumber1 (TInt aNumber1); 00038 IMPORT_C void SetNumber2 (TInt aNumber2); 00039 IMPORT_C TInt Number1 () const; 00040 IMPORT_C TInt Number2 () const; 00041 00042 // New functions added by DLL supplier for version 2 00043 IMPORT_C void NewOwnerFunction1(); 00044 IMPORT_C void NewOwnerFunction2(); 00045 IMPORT_C void NewOwnerFunction3(); 00046 IMPORT_C void NewOwnerFunction4(); 00047 IMPORT_C void NewOwnerFunction5(); 00048 00049 00050 // New functions added as a product specific extension to be implemented elsewhere 00051 // AddNumbers is a "non-intrusive" function that will be fully implemented in the extension 00052 IMPORT_C TInt AddNumbers() const; 00053 // MultiplyNumbers is an "intrusive" function that will be implemented in the orginal dll as DoMultiplyNumbers 00054 IMPORT_C TInt MultiplyNumbers() const; 00055 00056 private: //functions 00057 00058 // DoMultiplyNumbers is the local implementation of MultiplyNumbers. Private to force all clients to call it 00059 // via the MultiplyNumbers function in the extension dll. It must be implemented in this DLL as it needs access 00060 // to a constant which is defined in originaldll.dll 00061 IMPORT_C TInt DoMultiplyNumbers() const; 00062 00063 private: //data 00064 TInt iNumber1; 00065 TInt iNumber2; 00066 }; 00067 00068 #endif //__NUMBERSTORE_V2__