ralphint.h

Go to the documentation of this file.
00001 // $Id: ralphint.h 751 2006-03-31 15:43:49Z alex $
00002 // Definition of all Ralph's interfaces
00003 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE
00004 ================================XARAHEADERSTART===========================
00005  
00006                Xara LX, a vector drawing and manipulation program.
00007                     Copyright (C) 1993-2006 Xara Group Ltd.
00008        Copyright on certain contributions may be held in joint with their
00009               respective authors. See AUTHORS file for details.
00010 
00011 LICENSE TO USE AND MODIFY SOFTWARE
00012 ----------------------------------
00013 
00014 This file is part of Xara LX.
00015 
00016 Xara LX is free software; you can redistribute it and/or modify it
00017 under the terms of the GNU General Public License version 2 as published
00018 by the Free Software Foundation.
00019 
00020 Xara LX and its component source files are distributed in the hope
00021 that it will be useful, but WITHOUT ANY WARRANTY; without even the
00022 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00023 See the GNU General Public License for more details.
00024 
00025 You should have received a copy of the GNU General Public License along
00026 with Xara LX (see the file GPL in the root directory of the
00027 distribution); if not, write to the Free Software Foundation, Inc., 51
00028 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00029 
00030 
00031 ADDITIONAL RIGHTS
00032 -----------------
00033 
00034 Conditional upon your continuing compliance with the GNU General Public
00035 License described above, Xara Group Ltd grants to you certain additional
00036 rights. 
00037 
00038 The additional rights are to use, modify, and distribute the software
00039 together with the wxWidgets library, the wxXtra library, and the "CDraw"
00040 library and any other such library that any version of Xara LX relased
00041 by Xara Group Ltd requires in order to compile and execute, including
00042 the static linking of that library to XaraLX. In the case of the
00043 "CDraw" library, you may satisfy obligation under the GNU General Public
00044 License to provide source code by providing a binary copy of the library
00045 concerned and a copy of the license accompanying it.
00046 
00047 Nothing in this section restricts any of the rights you have under
00048 the GNU General Public License.
00049 
00050 
00051 SCOPE OF LICENSE
00052 ----------------
00053 
00054 This license applies to this program (XaraLX) and its constituent source
00055 files only, and does not necessarily apply to other Xara products which may
00056 in part share the same code base, and are subject to their own licensing
00057 terms.
00058 
00059 This license does not apply to files in the wxXtra directory, which
00060 are built into a separate library, and are subject to the wxWindows
00061 license contained within that directory in the file "WXXTRA-LICENSE".
00062 
00063 This license does not apply to the binary libraries (if any) within
00064 the "libs" directory, which are subject to a separate license contained
00065 within that directory in the file "LIBS-LICENSE".
00066 
00067 
00068 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS
00069 ----------------------------------------------
00070 
00071 Subject to the terms of the GNU Public License (see above), you are
00072 free to do whatever you like with your modifications. However, you may
00073 (at your option) wish contribute them to Xara's source tree. You can
00074 find details of how to do this at:
00075   http://www.xaraxtreme.org/developers/
00076 
00077 Prior to contributing your modifications, you will need to complete our
00078 contributor agreement. This can be found at:
00079   http://www.xaraxtreme.org/developers/contribute/
00080 
00081 Please note that Xara will not accept modifications which modify any of
00082 the text between the start and end of this header (marked
00083 XARAHEADERSTART and XARAHEADEREND).
00084 
00085 
00086 MARKS
00087 -----
00088 
00089 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara
00090 designs are registered or unregistered trademarks, design-marks, and/or
00091 service marks of Xara Group Ltd. All rights in these marks are reserved.
00092 
00093 
00094       Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK.
00095                         http://www.xara.com/
00096 
00097 =================================XARAHEADEREND============================
00098  */
00099 
00100 #ifndef INC_RALPHINT
00101 #define INC_RALPHINT
00102 
00103 //#include <afxole.h>
00104 
00105 #define RALPH_E_BADFILE             ((HRESULT)0x8534E102L)
00106 #define RALPH_E_EMPTYFILE           ((HRESULT)0x8534E108L)
00107 #define RALPH_E_FILEOPENFAILED      ((HRESULT)0x8534E105L)
00108 #define RALPH_E_INVALIDID           ((HRESULT)0x8534E106L)
00109 #define RALPH_E_MISSINGFILES        ((HRESULT)0x8534E104L)
00110 #define RALPH_E_NOFILTER            ((HRESULT)0x8534E100L)
00111 #define RALPH_E_NONSUPPORTEDTYPE    ((HRESULT)0x8534E101L)
00112 #define RALPH_E_NOVIEWER            ((HRESULT)0x8534E10AL)
00113 #define RALPH_E_OUTOFMEMORY         ((HRESULT)0x8534E107L)
00114 #define RALPH_E_PROTECTEDFILE       ((HRESULT)0x8534E109L)
00115 #define RALPH_E_UNEXPECTED          ((HRESULT)0x8534E103L)
00116 
00117 #define RALPH_E_LOADFAILED          ((HRESULT)0x8534E10BL)
00118 #define RALPH_E_INTERNAL            ((HRESULT)0x8534E10CL)
00119 #define RALPH_E_ABORTLOAD           ((HRESULT)0x8534E10DL)
00120 
00121 
00122 PORTNOTE("other","Removed IID usage")
00123 #ifndef EXCLUDE_FROM_XARALX
00124 // Define the interface ID's (GUIDS) for the RalphDoc's interfaces. 
00125 // {83104620-C3B4-11cf-8898-0020AFE14B87}
00126 static const IID IID_ICreation = 
00127             { 0x27682681, 0xd299, 0x11cf, 
00128             { 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33 } };
00129 static const IID IID_ICommandControl = 
00130             { 0x27682682, 0xd299, 0x11cf, 
00131             { 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33 } };
00132 static const IID IID_IViewControl = 
00133             { 0x27682683, 0xd299, 0x11cf, 
00134             { 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33 } };
00135 static const IID IID_IInitRalph = 
00136             { 0x27682684, 0xd299, 0x11cf, 
00137             { 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33 } };
00138 static const IID IID_IErrorCallback = 
00139             { 0x27682685, 0xd299, 0x11cf, 
00140             { 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33 } };
00141 
00142 static const IID IID_IAsynchDownLoad = 
00143             { 0x27682686, 0xd299, 0x11cf, 
00144             { 0xab, 0x39, 0x0, 0x20, 0xaf, 0x71, 0xe4, 0x33 } };
00145 #endif
00146 
00147 
00148 // define some types for the interfaces
00149 enum ToolMode       {NO_TOOL,ZOOM_TOOL,PUSH_TOOL}; 
00150 enum QualityLevel   {ANTI_ALIASED,NORMAL,SIMPLE,OUTLINE};
00151 enum DitherType     {ORDERED_DITHER,ERROR_DIFFUSE_DITHER,NO_DITHER};
00152 enum ViewMode       {PAGE_VIEW,DRAWING_VIEW,DOCUMENT_VIEW,DEFER_SETTINGVIEW};
00153 
00154 
00155 /********************************************************************************************
00156 
00157     class ICreation: public CCmdTarget
00158 
00159     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
00160     Created:    12/6/95
00161     Purpose:    Interface definition for the ICreation interface. 
00162 
00163 ********************************************************************************************/
00164 
00165 class ICreation : public IUnknown
00166 {
00167 public:
00168     // Loads a Document
00169     STDMETHOD (LoadDocument) (TCHAR* pFileToLoad) = 0;
00170 
00171     // Create a view window onto the document. If the ParentWnd parameter is
00172     // supplied then the window is created as a child of this window. If ParentWnd is 
00173     // NULL then the window is created as a popup (possible).
00174     // Initially we will probably allow a document to have only a single view associated with it. 
00175     STDMETHOD (CreateViewWindow)   (wxWindow * ParentWnd,
00176                                     ViewMode Viewmode,
00177                                     BOOL ShowScrollers,
00178                                     BOOL ShowWindow,
00179                                     BOOL HasBorder,
00180                                     wxWindow * * ViewWindow) =0;
00181     STDMETHOD (GetVerNum)   (TCHAR * pVerNum) =0;
00182     
00183     // This is intended mainly for printing
00184     STDMETHOD (RenderToDC)  (wxDC *TheDC, DWORD X, DWORD Y, DWORD Width, DWORD Height, DWORD DPI) =0;
00185 
00186 };
00187 
00188 
00189 
00190 /*******************************************************************************************
00191 
00192     class ICommandControl: public CCmdTarget
00193 
00194     Author:     Chris_Snook (Xara Group Ltd) <camelotdev@xara.com>
00195     Created:    12/6/95
00196     Purpose:    Interface definition for the ICommandControl interface. This will be supported
00197                 by a RalphDocument. 
00198 
00199 ********************************************************************************************/
00200 
00201 class ICommandControl : public IUnknown
00202 {
00203 public:
00204     // set ralph toolmode - currently supports NO_TOOL, PUSH_TOOL and ZOOM_TOOL
00205     STDMETHOD(SetToolMode)      (ToolMode toolmode) = 0;
00206     // just do a normal PreviousZoom op
00207     STDMETHOD(PreviousZoom)     () = 0;
00208     // do a ZoomToDrawing op
00209     STDMETHOD(ZoomToDrawing)    () = 0;
00210     // Zoom To 100%
00211     STDMETHOD(ZoomToFullScale)  () = 0;
00212     // set the render for this document (ANTI_ALIASED,NORMAL,SIMPLE,OUTLINE)
00213     STDMETHOD(SetQuality)       (QualityLevel Quality) = 0;
00214     // set the dither type for this document (ORDERED_DITHER,ERROR_DIFFUSE_DITHER,NO_DITHER)
00215     STDMETHOD(SetDitherType)    (DitherType Dither) = 0;
00216     // set the palette mode to foreground / background
00217     STDMETHOD(SetPaletteMode)   (BOOL Foreground) = 0;
00218     // Is there a previous zoom ? - this allows us to update the UI in the harness's
00219     STDMETHOD(HasPreviousZoom)  () = 0;
00220     // set the render for this document (ANTI_ALIASED,NORMAL,SIMPLE,OUTLINE)
00221     STDMETHOD(SetURL)           (wxString InURL) = 0;
00222 
00223 
00224 };
00225 
00226 class IViewControl : public IUnknown
00227 {
00228 public:
00229 
00230     STDMETHOD (ShowScrollers) (BOOL State) = 0;
00231     STDMETHOD (SetViewMode) (ViewMode Viewmode) = 0;
00232 };
00233 
00234 
00235 class IErrorCallback : public IUnknown
00236 {
00237 public:
00238     STDMETHOD(InformError) (HRESULT ErrCode)=0;
00239  
00240  };
00241 
00242 /*******************************************************************************************
00243 
00244     class IEventCallback
00245 
00246     Author:     Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
00247     Created:    20/07/96
00248     Purpose:    Interface definition for the IEventCallback interface. This interface will 
00249                 be implemented by a Harness that needs to respond to events sent from a 
00250                 RalphDocument. The interface is registered with a RalphDocument thru a 
00251                 call to IInitRalph::SetEventCallback. Note that it is not derived from 
00252                 IUnknown as there is no reason for it to have AddRef, Release, QueryInterface 
00253                 methods. 
00254 
00255 ********************************************************************************************/
00256 
00257 class IEventCallback : public IUnknown
00258 {
00259 public:
00260     // WebAddressSelected is called by a RalphDocument whenever the user selects a Web address
00261     STDMETHOD(WebAddressSelected) (wxString& WebAddress )=0;
00262     STDMETHOD(SetStatusBar) (wxString& StringToPass)=0;
00263 };
00264 
00265 
00266  
00267 class IInitRalph : public IUnknown
00268 {
00269 public:
00270     STDMETHOD(SetErrorCallback) (IErrorCallback* pCallbackInterface)=0;
00271 
00272  };
00273 
00274 
00275 
00276 class IAsynchDownLoad : public IUnknown
00277 {
00278 public:
00279     STDMETHOD(StartAsynchDownLoad) ()=0;
00280     STDMETHOD(OnDataAvailable) (unsigned char* pReadBuffer,DWORD BytesRead)=0;
00281     STDMETHOD(EndAsynchDownLoad) (HRESULT Status)=0;
00282 
00283 };
00284 
00285 #endif

Generated on Sat Nov 10 03:48:49 2007 for Camelot by  doxygen 1.4.4