uargs.hpp

00001 /* ==================================================== ======== ======= *
00002  *
00003  *  uargs.hpp : additive arglists.
00004  *  Part of the Ubit GUI Toolkit
00005  *  (C) 1999-2005 Eric Lecolinet / ENST Paris / http://www.enst.fr/~elc/ubit
00006  *
00007  * ***********************************************************************
00008  * COPYRIGHT NOTICE : 
00009  * THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY AND WITHOUT EVEN THE 
00010  * IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 
00011  * YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT UNDER THE TERMS OF THE GNU 
00012  * GENERAL PUBLIC LICENSE AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION; 
00013  * EITHER VERSION 2 OF THE LICENSE, OR (AT YOUR OPTION) ANY LATER VERSION.
00014  * SEE FILES 'COPYRIGHT' AND 'COPYING' FOR MORE DETAILS.
00015  * ***********************************************************************
00016  * ==================================================== [(c)Elc] ======= *
00017  * ==================================================== ======== ======= */
00018 
00019 #ifndef _uargs_hpp_
00020 #define _uargs_hpp_
00021 //pragma ident  "@(#)uargs.hpp  ubit:05.05.00"
00022 #include <ubit/ubrick.hpp>
00023 namespace ubit {
00024 
00025 class UArgsImpl;
00026 
00027 class UArgsList : public UChildren {
00028   friend class UArgs;
00029   friend class UArgsImpl;
00030   int refcount;
00031 };
00032 
00033 /* ==================================================== ======== ======= */
00039 class UArgs {
00040 public:
00041   static const UArgs none;
00042 
00043   UArgs();
00044   ~UArgs();
00045   UArgs(const UArgs&);
00046   UArgs(const UArgsImpl&);
00047   UArgs(const char*);
00048   UArgs(UBrick*);
00049   UArgs(UBrick&);
00050   UArgs(const UChild&);
00051 
00052   UArgs& operator+=(const UArgs&);
00053   friend const UArgsImpl& operator+(const UArgsImpl&, const char*);
00054   friend const UArgsImpl& operator+(const UArgsImpl&, UBrick*);
00055   friend const UArgsImpl& operator+(const UArgsImpl&, UBrick&);
00056   friend const UArgsImpl& operator+(const UArgsImpl&, const UChild&);
00057   friend const UArgsImpl& operator+(const UArgsImpl&, const UArgs&);
00058 
00059 //private:
00060   UArgsList* children;
00061 private:
00062   friend class UGroup;
00063   friend class UBox;
00064   friend class UArgsImpl;
00065   UArgs& operator=(const UArgs&);  
00066 };
00067 
00068 /* ==================================================== ======== ======= */
00069 // implementation of UArgs (should not be used directly by clients).
00070 
00071 class UArgsImpl {
00072 public:
00073   UArgsImpl();
00074   ~UArgsImpl();
00075   UArgsImpl(const UArgsImpl&);
00076   UArgsImpl(const UArgs&);
00077   UArgsImpl(const char*);
00078   UArgsImpl(UBrick*);
00079   UArgsImpl(UBrick&);
00080   UArgsImpl(const UChild&);
00081   
00082   friend const UArgsImpl& operator+(const UArgsImpl&, const char*);
00083   friend const UArgsImpl& operator+(const UArgsImpl&, UBrick*);
00084   friend const UArgsImpl& operator+(const UArgsImpl&, UBrick&);
00085   friend const UArgsImpl& operator+(const UArgsImpl&, const UChild&);
00086   friend const UArgsImpl& operator+(const UArgsImpl&, const UArgs&);
00087 
00088 private:
00089   friend class UGroup;
00090   friend class UBox;
00091   friend class UArgs;
00092   UArgsImpl& operator=(const UArgsImpl&);  // assigment is forbidden
00093   UArgsList* children;
00094 };
00095 
00096 }
00097 #endif
00098 /* ==================================================== [TheEnd] ======= */
00099 /* ==================================================== [(c)Elc] ======= */

Generated on Mon Jan 29 00:20:36 2007 for Ubit by  doxygen 1.4.7