home *** CD-ROM | disk | FTP | other *** search
- #ifndef _IDRGSTR_
- #define _IDRGSTR_
- /*--------------------------------------------------------------*/
- /* CLASS NAMES: ITypesString */
- /* IRMFsString */
- /* */
- /* DESCRIPTION : These are Types and RMFs wrap ups. */
- /* Created to avoid using the incomplete */
- /* Drg*() APIs for manipulation and verification */
- /* of Types and RMFs */
- /* */
- /* CHANGE ACTIVITY: */
- /* --------------- */
- /* DATE: INITIAL: DESCRIPTION: */
- /* 09/14/92 PHG Creation */
- /* */
- /*--------------------------------------------------------------*/
- /* Copyright (c) IBM Corporation 1991 */
- /*--------------------------------------------------------------*/
- // include ICLUI string support
- #ifndef _ISTRING_
- #include <IString.hpp>
- #endif
-
- #ifndef _IHANDLE_
- #include <IHandle.hpp>
- #endif
-
- class ITypesString : public IBase {
- /**************************************************************************
- * This class provides means to manipulate Drag&Drop types strings, which *
- * are strings of one ore more types separated by comas *
- **************************************************************************/
- public:
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------+
- | There are 3 ways to construct instances of this class: |
- | 1. From a string pointer which holds types |
- | 2. From an IString which holds types |
- | 3. From a string handle, which can come from a dragitem |
- +------------------------------------------------------------------------*/
- ITypesString(const char* pszTypes);
- ITypesString(const IString& strTypes);
- ITypesString(const IStringHandle& strhTypes);
-
- /*-------------------------------- ACCESSORS -----------------------------+
- | These function provide means of getting and setting the accessible |
- | attributes of instances of this class: |
- | count - returns the count of types in the string |
- | type - returns the nth type in the list (1-based) |
- | trueType - returns the true type (first type in the list) |
- | verifyTrueType - to verify if given type is the True type |
- | verifyTrueType - return the 1-based index of the true type |
- | within the argument string |
- | verifyType - return the 1-based index of the first matching type |
- +------------------------------------------------------------------------*/
- unsigned
- count() const;
-
- IString
- type(unsigned uIndex) const;
-
- IString
- trueType() const;
-
- // verify the True type
- Boolean
- verifyTrueType(const char* pszType) const;
-
- unsigned
- verifyTrueType(const ITypesString& strTypes) const,
- verifyType(const ITypesString& strTypes) const;
-
- /*------------------------- OPERATORS/CONVERTORS -------------------------+
- | operator IString() - convert to a string | |
- | asString - return a string |
- | operator+= - concatenate a string |
- | asStringHandle - return as a string handle |
- +------------------------------------------------------------------------*/
- operator IString() const;
- IString
- asString() const;
-
- ITypesString&
- operator+=(const IString& strIn);
-
- IStringHandle
- asStringHandle() const;
-
-
- private:
- /*--------------------------- PRIVATE FUNCTIONS --------------------------+
- | normalize - used to put string in normal from, i.e. without blanks |
- +------------------------------------------------------------------------*/
- static IString
- normalize(const IString& strIn);
-
- /*------------------------------ DATA MEMBERS ----------------------------+
- | strClTypes - types string |
- +------------------------------------------------------------------------*/
- IString strClTypes;
- }; // ITypesString
-
-
- class IRMFsString : public IBase {
- /**************************************************************************
- * This class provides means to manipulate Drag&Drop Rendering Mechanism *
- * and Format strings, which are expanded to the normal format of pair *
- * separated by comas: *
- * <M1,F2>,<M3,F4> *
- * Input strings can also be in the cross-product format *
- * <M1,M2>x<F4,F5> *
- **************************************************************************/
- public:
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------+
- | There are 4 ways to construct instances of this class: |
- | 1. From a non-normalized string pointer |
- | 2. From a non-normalized IString instance |
- | 3. From a single pair of Mechanism and Format |
- | 4. From a string handle as passed in D&D events |
- +------------------------------------------------------------------------*/
- IRMFsString(const char* pszRMFs);
- IRMFsString(const IString& strRMFs);
- IRMFsString(const char* pszMechanism, const char* pszFormat);
- IRMFsString(const IStringHandle& strhRMFs);
-
- /*-------------------------------- ACCESSORS -----------------------------+
- | These function provide means of getting and setting the accessible |
- | attributes of instances of this class: |
- | count - returns the count of RMFs in the string |
- | RMF - returns the nth RMF in the list (1-based) |
- | nativeRMF - returns the native RMF (first RMF in the list) |
- | verifyNativeRMF - to verify if given RMF is the native RMF |
- | verifyNativeRMF - return the 1-based index of the native RMF |
- | within the argument string |
- | verifyRMF - return the 1-based index of the first matching RMF |
- +------------------------------------------------------------------------*/
- unsigned
- count() const;
-
- IString
- RMF(unsigned uIndex) const;
-
- IString
- nativeRMF() const;
-
- Boolean
- verifyNativeRMF(const char* pszRMF) const;
-
- unsigned
- verifyNativeRMF(const IRMFsString& strRMFs) const;
-
- unsigned
- verifyRMF(const IRMFsString& strRMFs) const;
-
-
- /*------------------------- OPERATORS/CONVERTORS -------------------------+
- | operator IString() - convert to a string | |
- | asString - return a string |
- | operator+= - concatenate a string |
- | asStringHandle - return as a string handle |
- +------------------------------------------------------------------------*/
- operator IString() const;
-
- IString
- asString() const;
-
- IRMFsString&
- operator+=(const IString& strIn);
-
- IStringHandle
- asStringHandle() const;
-
-
- private:
- /*--------------------------- PRIVATE FUNCTIONS --------------------------+
- | normalize - used to put string in normal from, i.e. without blanks |
- +------------------------------------------------------------------------*/
- static IString
- normalize(const IString& strIn);
-
- /*------------------------------ DATA MEMBERS ----------------------------+
- | strClRMFs - RMFs string |
- +------------------------------------------------------------------------*/
- IString strClRMFs;
-
- }; // IRMFsString
-
- #endif /* def _IDRGSTR_ */