optsprin.h

Go to the documentation of this file.
00001 // $Id: optsprin.h 1282 2006-06-09 09:46:49Z alex $
00002 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE
00003 ================================XARAHEADERSTART===========================
00004  
00005                Xara LX, a vector drawing and manipulation program.
00006                     Copyright (C) 1993-2006 Xara Group Ltd.
00007        Copyright on certain contributions may be held in joint with their
00008               respective authors. See AUTHORS file for details.
00009 
00010 LICENSE TO USE AND MODIFY SOFTWARE
00011 ----------------------------------
00012 
00013 This file is part of Xara LX.
00014 
00015 Xara LX is free software; you can redistribute it and/or modify it
00016 under the terms of the GNU General Public License version 2 as published
00017 by the Free Software Foundation.
00018 
00019 Xara LX and its component source files are distributed in the hope
00020 that it will be useful, but WITHOUT ANY WARRANTY; without even the
00021 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00022 See the GNU General Public License for more details.
00023 
00024 You should have received a copy of the GNU General Public License along
00025 with Xara LX (see the file GPL in the root directory of the
00026 distribution); if not, write to the Free Software Foundation, Inc., 51
00027 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00028 
00029 
00030 ADDITIONAL RIGHTS
00031 -----------------
00032 
00033 Conditional upon your continuing compliance with the GNU General Public
00034 License described above, Xara Group Ltd grants to you certain additional
00035 rights. 
00036 
00037 The additional rights are to use, modify, and distribute the software
00038 together with the wxWidgets library, the wxXtra library, and the "CDraw"
00039 library and any other such library that any version of Xara LX relased
00040 by Xara Group Ltd requires in order to compile and execute, including
00041 the static linking of that library to XaraLX. In the case of the
00042 "CDraw" library, you may satisfy obligation under the GNU General Public
00043 License to provide source code by providing a binary copy of the library
00044 concerned and a copy of the license accompanying it.
00045 
00046 Nothing in this section restricts any of the rights you have under
00047 the GNU General Public License.
00048 
00049 
00050 SCOPE OF LICENSE
00051 ----------------
00052 
00053 This license applies to this program (XaraLX) and its constituent source
00054 files only, and does not necessarily apply to other Xara products which may
00055 in part share the same code base, and are subject to their own licensing
00056 terms.
00057 
00058 This license does not apply to files in the wxXtra directory, which
00059 are built into a separate library, and are subject to the wxWindows
00060 license contained within that directory in the file "WXXTRA-LICENSE".
00061 
00062 This license does not apply to the binary libraries (if any) within
00063 the "libs" directory, which are subject to a separate license contained
00064 within that directory in the file "LIBS-LICENSE".
00065 
00066 
00067 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS
00068 ----------------------------------------------
00069 
00070 Subject to the terms of the GNU Public License (see above), you are
00071 free to do whatever you like with your modifications. However, you may
00072 (at your option) wish contribute them to Xara's source tree. You can
00073 find details of how to do this at:
00074   http://www.xaraxtreme.org/developers/
00075 
00076 Prior to contributing your modifications, you will need to complete our
00077 contributor agreement. This can be found at:
00078   http://www.xaraxtreme.org/developers/contribute/
00079 
00080 Please note that Xara will not accept modifications which modify any of
00081 the text between the start and end of this header (marked
00082 XARAHEADERSTART and XARAHEADEREND).
00083 
00084 
00085 MARKS
00086 -----
00087 
00088 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara
00089 designs are registered or unregistered trademarks, design-marks, and/or
00090 service marks of Xara Group Ltd. All rights in these marks are reserved.
00091 
00092 
00093       Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK.
00094                         http://www.xara.com/
00095 
00096 =================================XARAHEADEREND============================
00097  */
00098 //
00099 // Header for the handling code for the Print tabs of the options dialog box 
00100 //   WEBSTER-ranbirr-13/11/96
00101 #ifndef WEBSTER
00102 
00103 #ifndef INC_OPTSPRIN
00104 #define INC_OPTSPRIN
00105 
00106 //#include "dialogop.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00107 #include "appprefs.h"
00108 #include "printctl.h"
00109 
00110 //--------------------------------------------------
00111 class Layer;
00112 //#include "stockcol.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00113 
00114 /********************************************************************************************
00115 
00116 >   class PrintBaseTab: public OptionsTabs
00117 
00118     Author:     Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
00119     Created:    22/3/95
00120     Purpose:    Allows the user to set any options which are associated with general document printing.
00121 
00122     SeeAlso:    OptionsTabs; AppPrefsDlg; DocPrefsDlg;
00123 
00124 ********************************************************************************************/
00125 
00126 class PrintBaseTab: public OptionsTabs
00127 {         
00128     CC_DECLARE_DYNCREATE( PrintBaseTab )  
00129 public:
00130 
00131     PrintBaseTab();
00132     ~PrintBaseTab();
00133 
00134     // Function to set up the values on this tab when being opened
00135     virtual BOOL InitSection();
00136 
00137     // Function to handle dialogue messages. Called by derived classes for unhandled messages
00138     virtual BOOL HandleMsg(DialogMsg* Msg);
00139 
00140     // Functions to handle document changing messages
00141     virtual BOOL GreySection();                             // Called when the user has closed all documents
00142     virtual BOOL UngreySection();                           // Called when the user has opened a document
00143     virtual BOOL UpdateSection(String_256 *DocumentName);   // Called when the user has switched to a new document
00144     virtual BOOL PageSizeHasChanged();                      // Called when the spread's page changes size
00145 
00146     virtual BOOL IsDocumentOption();    // Return True if document option  
00147     virtual BOOL IsProgramOption();     // Return True if program option
00148     virtual BOOL IsPrintingOption();    // Return True if printing option
00149 
00150     BOOL IsAllGreyed() { return AllGreyed; }
00151 
00152     // Called when AppPrefsDlg::Message() gets a print settings changed message
00153     void PrintSettingsChanged();
00154 
00155     static void DocumentSettingsUpdated(void);
00156         // Called by the AppPrefs dlg when committing to make sure that we don't have an invalid PrintControl cache
00157 
00158 
00159 protected:
00160     void CopyLocalPrintControlFromDoc(void);                // Copy PrintCtrl data between the local copy and the
00161     void CopyLocalPrintControlToDoc(void);                  // selected document copy
00162 
00163     virtual BOOL CommitSection();
00164 
00165     PrintControl*   GetPrintControl();  // Finds the print control object contained within the associated doc
00166     void            EnableControl(CGadgetID Gadget, BOOL Enabled);  // Calls EnableGadget() taking AllGreyed into acount
00167     BOOL            TalkToPage();       // Calls pPrefsDlg->TalkToPage() with GetPageID() ID
00168 
00169     virtual BOOL EnableControls()   = 0;    // Enables/disables the controls
00170     virtual BOOL ShowDetails()      = 0;    // Displays the print control data in the tab
00171 
00172     // This local PrintControl contains a copy of the associated document's print control object.
00173     // The local copy is copied from the document when InitSection() and UpdateSection() is called.
00174     // The local copy is copied into the document when CommitSection() is called.
00175     // NOTE that we have a static print control because it must be SHARED by all the different tabs!
00176     // The document is a point to the last document we copied the info from - used only to allow us to
00177     // cache the data to stop multiple attempts to read it from continually overwriting other tab's "cache".
00178     static PrintControl LocalPrintControl;
00179     static Document *pLastPrintControlDocument;
00180 
00181 private:
00182     void UpdateDocName();
00183     BOOL AllGreyed;         // Remember the state that we are currently in
00184 
00185     friend class SepsDlg;
00186 }; 
00187 
00188 //-------------------------------------------------
00189 
00190 /********************************************************************************************
00191 
00192 >   class PrintGeneralTab: public PrintBaseTab
00193 
00194     Author:     Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
00195     Created:    22/3/95
00196     Purpose:    Allows the user to set any options which are associated with general document printing.
00197 
00198     SeeAlso:    OptionsTabs; AppPrefsDlg; DocPrefsDlg;
00199 
00200 ********************************************************************************************/
00201 
00202 class PrintGeneralTab: public PrintBaseTab
00203 {         
00204     CC_DECLARE_DYNCREATE( PrintGeneralTab )  
00205 public:
00206     PrintGeneralTab();
00207     ~PrintGeneralTab();
00208 
00209     // Function to handle the messages for this tab/pane window
00210     virtual BOOL HandleMsg(DialogMsg* Msg);
00211 
00212     // Function to commit the values on this tab on ok
00213     virtual BOOL CommitSection();
00214 
00215     // Return section/page id system
00216     virtual CDlgResID GetPageID();
00217 
00218 private:
00219     BOOL EnableControls();                              // Enable/disable all tab controls correctly
00220     virtual BOOL ShowDetails();
00221 }; 
00222 
00223 //-------------------------------------------------
00224 
00225 /********************************************************************************************
00226 
00227 >   class PrintLayoutTab: public PrintBaseTab
00228 
00229     Author:     Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
00230     Created:    22/3/95
00231     Purpose:    Allows the user to set any options which are associated with general document printing.
00232 
00233     SeeAlso:    OptionsTabs; AppPrefsDlg; DocPrefsDlg;
00234 
00235 ********************************************************************************************/
00236 
00237 class PrintLayoutTab: public PrintBaseTab
00238 {         
00239     CC_DECLARE_DYNCREATE( PrintLayoutTab )  
00240 public:
00241     PrintLayoutTab();
00242     ~PrintLayoutTab();
00243 
00244     // Function to handle the messages for this tab/pane window
00245     virtual BOOL HandleMsg(DialogMsg* Msg);
00246 
00247     // Function to commit the values on this tab on ok
00248     virtual BOOL CommitSection();
00249 
00250     // Function to set up the values on this tab when being opened
00251     virtual BOOL InitSection();
00252 
00253     // Return section/page id system
00254     virtual CDlgResID GetPageID();
00255 
00256 private:
00257     BOOL EnableControls();                              // Enable/disable all tab controls correctly
00258     virtual BOOL ShowDetails();
00259     
00260     BOOL ShowDetails(CGadgetID* pGadgetIDList,CGadgetID Exclude);
00261 
00262 public:
00263     #ifdef _DEBUG
00264     static void TestPrinting(PrintControl* pPrCtrl);
00265     static void MakeRectangle(Layer* pLayer,DocRect Rect,StockColour Col);
00266     #endif
00267 }; 
00268 
00269 
00270 class SepsDlgParam : public OpParam
00271 {
00272 public:
00273     ColourPlate *pColourPlate;
00274     PrintBaseTab* pParent;
00275     BOOL Result;
00276 };
00277 
00278 
00279 /********************************************************************************************
00280 
00281 >   class SepsDlg : public DialogOp
00282 
00283     Author:     Adrian_Stoicar (Xara Group Ltd) <camelotdev@xara.com>
00284     Created:    18/6/96
00285     Purpose:    Dialog for changing the properties of individual separations
00286 
00287     SeeAlso:    PrintSepsTab
00288 
00289 ********************************************************************************************/
00290 
00291 #define OPTOKEN_SEPSDIALOG _T("SepsDialog")
00292 
00293 class SepsDlg : public DialogOp
00294 {
00295     public:
00296         SepsDlg();
00297         ~SepsDlg();
00298 
00299         MsgResult Message(Msg* Message);
00300         BOOL Create();
00301 
00302         static const INT32 IDD;
00303         static const CDlgMode Mode;
00304 
00305         static OpState GetState(String_256*, OpDescriptor*);
00306 
00307         void Do(OpDescriptor*);
00308         void DoWithParam(OpDescriptor*, OpParam *Param);
00309 
00310         static BOOL Init(void);
00311         static BOOL InvokeDialog(ColourPlate *pTheColourPlate, PrintBaseTab* pParentDialog);
00312 
00313     protected:
00314         void InitControls(void);
00315         MsgResult HandleMessage(DialogMsg* Msg);
00316 
00317     private:
00318         ColourPlate* pColourPlate;
00319         ColourPlate* pLocalColourPlate;
00320         PrintBaseTab* pParent;
00321         SepsDlgParam *pParam;
00322 
00323     CC_DECLARE_DYNCREATE(SepsDlg);
00324 };
00325 
00326 
00327 
00328 
00329 /********************************************************************************************
00330 
00331 >   class PrintSepsTab: public PrintBaseTab
00332 
00333     Author:     Adrian_Stoicar (Xara Group Ltd) <camelotdev@xara.com>
00334     Created:    12/6/96
00335     Purpose:    Allows the user to set options which are associated with printing colour separations.
00336 
00337     SeeAlso:    OptionsTabs; AppPrefsDlg; DocPrefsDlg;
00338 
00339 ********************************************************************************************/
00340 
00341 class PrintSepsTab: public PrintBaseTab
00342 {         
00343     CC_DECLARE_DYNCREATE( PrintSepsTab )  
00344 public:
00345     PrintSepsTab();
00346     ~PrintSepsTab();
00347 
00348     // Function to handle dialog messages for this tab/pane window
00349     virtual BOOL HandleMsg(DialogMsg* Msg);
00350 
00351     // Function to handle generic messages for this tab/pane window
00352     virtual MsgResult Message(Msg *pMessage);
00353 
00354     // Function to commit the values on this tab on ok
00355     virtual BOOL CommitSection();
00356 
00357     // Function to set up the values on this tab when being opened/closed/shaded/unshaded
00358     virtual BOOL InitSection();
00359     virtual BOOL GreySection();             // Called when the user has closed all documents
00360     virtual BOOL UngreySection();           // Called when the user has opened a document
00361     virtual BOOL UpdateSection(String_256 *DocumentName);   // Called when the user has switched to a new document
00362 
00363     // Return section/page id system
00364     virtual CDlgResID GetPageID();
00365 
00366 
00367 private:
00368         INT32 ConvertDoubleToMinString(double Value, String_256 *Result);
00369                 // Converts a double into a string with a minimal number of decimal places, up to a max of 4.
00370                 // e.g 1.23456 -> 1.2345    1.230000 -> 1.23    1.00001 -> 1.0
00371 
00372         void ReadCurrentPlateSettings(TypesetInfo *pTypesetInfo);
00373                 // Reads the current plate settings for all plates into the given TypesetInfo structure
00374 
00375 private:
00376     BOOL OldPrintSpotsAsProcess;            // Used to allow cancel of this option (which must be applied interactively)
00377 
00378 private:
00379     BOOL EnableControls();                              // Enable/disable all tab controls correctly
00380     virtual BOOL ShowDetails();
00381     ColourPlate* GetSelectedPlate();
00382     BOOL ShowDetails(CGadgetID* pGadgetIDList,CGadgetID Exclude);
00383 
00384 /*
00385 public:
00386     #ifdef _DEBUG
00387     static void TestPrinting(PrintControl* pPrCtrl);
00388     static void MakeRectangle(Layer* pLayer,DocRect Rect,StockColour Col);
00389     #endif
00390 
00391 */
00392 
00393 }; 
00394 
00395 //-------------------------------------------------
00396 
00397 /********************************************************************************************
00398 
00399 >   class PrintImagesetterTab: public PrintBaseTab
00400 
00401     Author:     Adrian_Stoicar (Xara Group Ltd) <camelotdev@xara.com>
00402     Created:    10/07/96
00403     Purpose:    Allows the user to set various imagesetting options.
00404 
00405     SeeAlso:    OptionsTabs; AppPrefsDlg; DocPrefsDlg;
00406 
00407 ********************************************************************************************/
00408 
00409 class PrintImagesetterTab: public PrintBaseTab
00410 {         
00411     CC_DECLARE_DYNCREATE( PrintImagesetterTab )  
00412 public:
00413     PrintImagesetterTab();
00414     ~PrintImagesetterTab();
00415 
00416     // Function to handle the messages for this tab/pane window
00417     virtual BOOL HandleMsg(DialogMsg* Msg);
00418 
00419     // Function to handle generic messages for this tab/pane window
00420     virtual MsgResult Message(Msg *pMessage);
00421 
00422     // Function to commit the values on this tab on ok
00423     virtual BOOL CommitSection();
00424 
00425     // Function to set up the values on this tab when being opened
00426     virtual BOOL InitSection();
00427 
00428     virtual BOOL GreySection();             // Called when the user has closed all documents
00429 
00430     virtual BOOL UngreySection();           // Called when the user has opened a document
00431     
00432     virtual BOOL UpdateSection(String_256 *DocumentName);   // Called when the user has switched to a new document
00433 
00434     // Return section/page id system
00435     virtual CDlgResID GetPageID();
00436 
00437 
00438 private:
00439     BOOL EnableControls();                              // Enable/disable all tab controls correctly
00440     virtual BOOL ShowDetails();
00441 
00442 
00443 private:
00444     void EnsureSensiblePrintMarks(void);                // Make sure no 2 star/target marks are simultaneously enabled
00445 };
00446 
00447 
00448 
00449 
00450 #define OPTOKEN_SHOWPRINTBORDERS    _T("ShowPrintBorders")
00451 
00452 class OpDescriptor;
00453 
00454 /*******************************************************************************************
00455 
00456 >   class OpShowPrintBorders : public Operation
00457 
00458     Author:     Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
00459     Created:    10/5/95
00460     Purpose:    Allows the user to toggle the visible state of the print borders
00461     Notes:      -
00462 
00463 ********************************************************************************************/
00464 
00465 class OpShowPrintBorders : public Operation
00466 {
00467     CC_DECLARE_DYNCREATE( OpShowPrintBorders )
00468 
00469 public:
00470     OpShowPrintBorders();
00471 
00472     void Do(OpDescriptor*);
00473 
00474     static BOOL Init();
00475     static OpState GetState(String_256*, OpDescriptor*);
00476 };
00477 
00478 
00479 
00480 #endif // INC_OPTSPRIN
00481 
00482 #endif //webster

Generated on Sat Nov 10 03:46:21 2007 for Camelot by  doxygen 1.4.4