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 // 00019 00020 #if !defined(__NUMBERSTORE_V2__) 00021 #define __NUMBERSTORE_V2__ 00022 00023 #include <e32std.h> 00024 #include <e32base.h> 00025 00026 /* class CNumberStore 00027 A trivial class to own two numbers */ 00028 class CNumberStore : public CBase 00029 { 00030 public: //functions 00031 00032 // Original functions contained in dll from supplier 00033 IMPORT_C CNumberStore (); 00034 IMPORT_C CNumberStore (TInt aNumber1, TInt aNumber2); 00035 IMPORT_C void SetNumber1 (TInt aNumber1); 00036 IMPORT_C void SetNumber2 (TInt aNumber2); 00037 IMPORT_C TInt Number1 () const; 00038 IMPORT_C TInt Number2 () const; 00039 00040 // New functions added as a product specific extension to be implemented elsewhere 00041 // AddNumbers is a "non-intrusive" function that will be fully implemented in the extension 00042 IMPORT_C TInt AddNumbers() const; 00043 // MultiplyNumbers is an "intrusive" function that will be implemented in the orginal dll as DoMultiplyNumbers 00044 IMPORT_C TInt MultiplyNumbers() const; 00045 00046 private: //functions 00047 00048 // DoMultiplyNumbers is the local implementation of MultiplyNumbers. Private to force all clients to call it 00049 // via the MultiplyNumbers function in the extension dll. It must be implemented in this DLL as it needs access 00050 // to a constant which is defined in originaldll.dll 00051 IMPORT_C TInt DoMultiplyNumbers() const; 00052 00053 private: //data 00054 TInt iNumber1; 00055 TInt iNumber2; 00056 }; 00057 00058 #endif //__NUMBERSTORE_V2__