diff options
Diffstat (limited to 'media/libdrm/mobile2/include')
31 files changed, 0 insertions, 3220 deletions
diff --git a/media/libdrm/mobile2/include/Drm2CommonTypes.h b/media/libdrm/mobile2/include/Drm2CommonTypes.h deleted file mode 100644 index 8ad3a73..0000000 --- a/media/libdrm/mobile2/include/Drm2CommonTypes.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef _DRM2COMMONTYPES_H_ -#define _DRM2COMMONTYPES_H_ -#include <stdint.h> - -#ifdef DRM2_UT -#define PROTECTED public -#define PRIVATE public -#else -#define PROTECTED protected -#define PRIVATE private -#endif - -#endif diff --git a/media/libdrm/mobile2/include/dcf/DrmDcfCommon.h b/media/libdrm/mobile2/include/dcf/DrmDcfCommon.h deleted file mode 100644 index 9ca7b3f..0000000 --- a/media/libdrm/mobile2/include/dcf/DrmDcfCommon.h +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __DCF_COMM_H__ -#define __DCF_COMM_H__ - -#include <Drm2CommonTypes.h> -#include <arpa/inet.h> -#include <mistream.h> -#include <ustring.h> - -using namespace ustl; - -////DCF box type list -const uint32_t DCF_CONTAINER_BOX = uint32_t('m' << 24 | 'r' << 16 | 'd' << 8 | 'o'); -const uint32_t DCF_USER_TYPE = uint32_t('d' << 24 | 'i' << 16 | 'u' << 8 | 'u'); -const uint32_t DCF_FILE_TYPE = uint32_t('p' << 24 | 'y' << 16 | 't' << 8 | 'f'); -const uint32_t DCF_FILE_BRAND = uint32_t('f' << 24 | 'c' << 16 | 'd' << 8 | 'o'); - - -/** - * The basic box class. - */ -class Box -{ -public: - /** - * constructor for Box, used to parse Box - * \param box Box data - */ - Box(const uint8_t* box); - - /** - * copy constructor for Box - * \param dcfBox Box object used to init a new Box object - */ - Box(const Box& dcfBox); - - /** - * assignment operator for Box - * \param other Box object used to assign to a exist Box object - */ - Box& operator=(const Box& other); - - /** Destructor for Box */ - virtual ~Box(); - - /** - * get the size of Box - * \param none - * \return - * the size - */ - uint64_t getSize(void) const; - - /** - * get the type of Box - * \param none - * \return - * the type - */ - uint32_t getType(void) const; - - /** - * get the user type of Box - * \param none - * \return - * the user type - */ - const uint8_t* getUsertype(void) const; - - /** - * get the length of Box - * \param none - * \return - * the length - */ - virtual uint32_t getLen(void) const; -PRIVATE: - static const uint32_t USER_TYPE_LEN = 16; - - uint32_t mSize; - uint32_t mType; - uint64_t mLargeSize; - uint8_t* mUserType; - uint32_t mBoxLength; -}; - -/** - * The fullBox class. - */ -class FullBox : public Box -{ -public: - /** - * constructor for FullBox, used to parse FullBox - * \param fullBox FullBox data - */ - FullBox(const uint8_t* fullBox); - - /** Destructor for FullBox */ - virtual ~FullBox(){} - - /** - * get the version of FullBox - * \param none - * \return - * the version - */ - uint8_t getVersion(void) const; - - /** - * get the flag of FullBox - * \param none - * \return - * the flag - */ - const uint8_t* getFlag(void) const; - - /** - * get the length of FullBox - * \param none - * \return - * the length - */ - virtual uint32_t getLen(void) const; -PRIVATE: - static const uint32_t FLAG_LEN = 3; - - uint8_t mVersion; - uint8_t mFlag[FLAG_LEN]; - uint32_t mFullBoxLength; -}; - -////// textal header class -class TextualHeader -{ -public: - /** default constructor of DrmInStream */ - TextualHeader(){}; - - /** - * constructor for TextualHeader, used to parse textal header - * \param inData textal header data - */ - TextualHeader(const string& inData); - - /** - * get the name of textal header - * \param none - * \return - * the name - */ - string getName() const; - - /** - * get the value of textal header - * \param none - * \return - * the value - */ - string getValue() const; - - /** - * get the parameter of textal header - * \param none - * \return - * the parameter - */ - string getParam() const; -PRIVATE: - string name; - string value; - string param; -}; - -extern int64_t ntoh_int64(int64_t in); - -#endif diff --git a/media/libdrm/mobile2/include/dcf/DrmDcfContainer.h b/media/libdrm/mobile2/include/dcf/DrmDcfContainer.h deleted file mode 100644 index 14da450..0000000 --- a/media/libdrm/mobile2/include/dcf/DrmDcfContainer.h +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __DCF_CONTAINER_H__ -#define __DCF_CONTAINER_H__ - -#include <Drm2CommonTypes.h> -#include <uvector.h> -#include <dcf/DrmIStream.h> -#include <dcf/DrmDcfCommon.h> - -class DrmInStream; - -/////////dcf container -class DcfContainer : public FullBox -{ -public: - friend class DrmInStream; - - /** default constructor of DcfContainer */ - DcfContainer(istream& inRawData):FullBox(NULL),mConStream(inRawData){} - - /** - * constructor for DcfContainer, used to parse DCF container - * \param data DCF container data - * \param len DCF container data len - * \param off the offset from the start of DCF container - */ - DcfContainer(const uint8_t* data,istream& inRawData,uint64_t conOff); - - /** Destructor for DcfContainer */ - ~DcfContainer(); - - /** - * get the content type of one content - * \param none - * \return - * the content type - */ - string getContentType(void) const; - - /** - * get the encryption method apply to content - * \param none - * \return - * the encryption method - */ - uint8_t getEncryptionMethod(void) const; - - /** - * get the padding scheme apply to content - * \param none - * \return - * the padding scheme - */ - uint8_t getPaddingScheme(void) const; - - /** - * get the length of plain content - * \param none - * \return - * the length of plain content - */ - uint64_t getPlaintextLength(void) const; - - /** - * get the length of content ID - * \param none - * \return - * the length of content ID - */ - uint16_t getContentIDLength(void) const; - - /** - * get the length of rights issuer URL - * \param none - * \return - * the length of rights issuer URL - */ - uint16_t getRightsIssuerURLLength(void) const; - - /** - * get the length of textal header - * \param none - * \return - * the length of textal header - */ - uint16_t getTextualHeadersLength(void) const; - - /** - * get the content ID of one content - * \param none - * \return - * the content ID - */ - string getContentID(void) const; - - /** - * get the rights issuer URL - * \param none - * \return - * the rights issuer URL - */ - string getRightsIssuerURL(void) const; - - /** - * get the preview method - * \param none - * \return - * the preview method - */ - string getPreviewMethod(void) const; - - /** - * get the location of content - * \param none - * \return - * the location of content - */ - string getContentLocation(void) const; - - /** - * get the URL of content - * \param none - * \return - * the URL of content - */ - string getContentURL(void) const; - - /** - * get the customer head - * \param none - * \return - * the customer head - */ - vector<string> getCustomerHead(void) const; - - /** - * get the preview element data - * \param none - * \return - * the DRM Instream of preview element data - */ - DrmInStream getPreviewElementData(void) const; - - /** - * get the plain content - * \param none - * \return - * the DRM Instream of plain content - */ - DrmInStream getDecryptContent(uint8_t* decryptKey) const; - - /** - * get the istream of DCF - * \param none - * \return - * the istream of DCF - */ - istream& getStream(void) const; - -PRIVATE: - static const uint32_t USER_DATA_FLAG = 0x01; - - uint8_t mContentTypeLen; - string mContentType; - uint8_t mEncryptionMethod; - uint8_t mPaddingScheme; - uint64_t mPlaintextLength; - uint16_t mContentIDLength; - uint16_t mRightsIssuerURLLength; - uint16_t mTextualHeadersLength; - string mContentID; - string mRightsIssuerURL; - vector<TextualHeader*> mTextualHeaders; - bool mSilentFirst; - string mSlientMethod; - string mSilentRightsURL; - string mPreviewMethod; - string mPreviewElementURI; - string mPreviewRightsURL; - string mContentURL; - string mContentVersion; - string mContentLocation; - vector<string> mCustomHeader; - bool mHasUserData; - uint64_t mDataLen; - istream& mConStream; - uint64_t mDecOffset; - -PRIVATE: - // parse text header - bool parseTextualHeaders(const uint8_t* data, uint32_t len); - void copy(const DcfContainer& container); - DcfContainer(const DcfContainer& container):FullBox(NULL),mConStream(container.mConStream){} - DcfContainer& operator=(const DcfContainer& other){return *this;} -}; - - -#endif diff --git a/media/libdrm/mobile2/include/dcf/DrmIStream.h b/media/libdrm/mobile2/include/dcf/DrmIStream.h deleted file mode 100644 index 10e264e..0000000 --- a/media/libdrm/mobile2/include/dcf/DrmIStream.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __DRM_ISTREAM_H__ -#define __DRM_ISTREAM_H__ - -#include <Drm2CommonTypes.h> -#include <util/crypto/DrmCrypto.h> -#include <dcf/DrmDcfContainer.h> -#include <ustring.h> - -using namespace ustl; - -class DcfContainer; - -class DrmInStream -{ -public: - /** default constructor of DrmInStream */ - DrmInStream():mDecryptPos(0){} - - /** - * constructor for DrmInStream, used to read DCF content - * \param encFile DCF container data - * \param len DCF container data len - * \param off the offset from the start of DCF container - */ - DrmInStream(const DcfContainer* container,uint8_t* Key); - - /** - * get the size of DRM Instream - * \param none - * \return - * the size of DRM Instream - */ - uint64_t size() const; - - /** - * read data from DRM Instream - * \param data the buffer to store read data - * \param len how much data need to read - * \return - * the actual len of read data - */ - uint64_t read(uint8_t* data,uint64_t len); - -PRIVATE: - static const uint32_t AES_IV_LEN = 16; - static const uint32_t AES_KEY_LEN = 16; - static const uint32_t AES_BLOCK_LEN = 16; - - const DcfContainer* mDcfCon; - uint64_t mDecryptPos; - uint8_t mAesKey[AES_KEY_LEN]; -}; - - - -#endif - - - - - diff --git a/media/libdrm/mobile2/include/dcf/DrmRawContent.h b/media/libdrm/mobile2/include/dcf/DrmRawContent.h deleted file mode 100644 index 2d433af..0000000 --- a/media/libdrm/mobile2/include/dcf/DrmRawContent.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __DRM_CONTENT_H__ -#define __DRM_CONTENT_H__ - -#include <Drm2CommonTypes.h> -#include <dcf/DrmDcfContainer.h> - -/////////////raw content -class DrmRawContent -{ -public: - /** - * constructor for DrmRawContent, used to parse DCF - * \param inRawData input stream of raw data. - */ - DrmRawContent(istream& inRawData); - - /** Destructor for DrmRawContent */ - ~DrmRawContent(); - - /** - * get DCF container - * \param none - * \return - * the DCF container - */ - vector<DcfContainer*> getContents(void) const; - - /** - * get the length of DCF hash - * \param none - * \return - * the length of DCF hash - */ - uint32_t getDcfHashLen() const; - - /** - * get DCF hash - * \param outDcfHash the buffer to store DCF hash - * \return - * none - */ - void getDcfHash(uint8_t* outDcfHash) const; - -PRIVATE: - static const uint32_t DCF_HASH_LEN = 20; - static const uint32_t FIX_HEADER_LEN = 20; - static const uint32_t MAX_PIECE_LEN = (100 * 1024); - - uint8_t mDcfHash[DCF_HASH_LEN]; - vector<DcfContainer*> mContainer; - -PRIVATE: - bool parseDcfHeader(const uint8_t* dcfHead); - DrmRawContent(const DrmRawContent& rawContent){} - DrmRawContent& operator=(const DrmRawContent& other){return *this;} -}; - -#endif diff --git a/media/libdrm/mobile2/include/drmmanager/DrmManager.h b/media/libdrm/mobile2/include/drmmanager/DrmManager.h deleted file mode 100644 index c8bfbc1..0000000 --- a/media/libdrm/mobile2/include/drmmanager/DrmManager.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */
-#ifndef _DRMMANAGER_ -#define _DRMMANAGER_ - -#include <Drm2CommonTypes.h> -#include <ofstream.h> -#include <sostream.h> -#include <ustring.h> -#include <sistream.h> -#include <uvector.h> - -using namespace ustl; - -/** It should be removed after real DcfContainer is ready */ -#define DcfContainer string -static const int16_t DRM_OK = 1; - -class DrmManager -{ -public: - /** - * Error definition - */ - static const int16_t DRM_MANAGER_BASE = 100; - static const int16_t ERR_DCFSTREAM_NOT_INITIALIZED = DRM_MANAGER_BASE+1; - static const int16_t ERR_WRONG_DCFDATA = DRM_MANAGER_BASE+2; - static const int16_t ERR_WRONG_RIGHTS = DRM_MANAGER_BASE+3; - - /** - * Constructor for DrmManager,used to open local dcf file. - * @param inRawData input stream of raw data. - */ - DrmManager(istream *inRawData); - - /** - * Constructor for DrmManager,used to separate dcf file and trig message when upper - * application downloading one multipart message from CI. - * @param inRawData input stream of raw data. - */ - DrmManager(istream * inRawData, string mimeType); - - /** Destructor for DomExpatAgent. */ - ~DrmManager(); - /** - * Config DRM engine - * Fix me later - */ - bool config(); - - /** - * Consume rights according to specified operation, DrmManager will check. - * @param operationType the type of operation. - * @return the operation result. - */ - int16_t consumeRights(int16_t operationType); - - /** - * Get the list of all dcf containers object reference in the dcf file. - * @param the vector of the dcf objects list returned. - * @return the operation result. - */ - int16_t getListOfDcfObjects(vector<DcfContainer*> **outDcfList); - - /** - * Open one Dcf container to read the decrypted data according to specified - * operation. - * @param oneDcfObject the reference of the DcfContainer. - * @param operationType the type of operation. - * @param decrypted data returned. - * @return the operation result. - */ - int16_t openDecryptedContent(DcfContainer *oneDcfObject, - int16_t operationType, - istream *outDecryptedData); - - /** - * Get the separated Dcf raw data from multipart message. - * @return the ifstream of the dcf raw data which should be stored by upper - * application. - */ - ifstream* getOriginalMediaData(void); - - /** - * Handle DRM2.0 push message - */ - bool handlePushMsg(uint8_t* data, string mimeType); - -PRIVATE: - istream *mDcfStream; /**< the handler of dcf stream. */ - vector<DcfContainer*> mDcfs; /**< all the dcf containers included in one dcf file. */ -}; - -#endif //_DRMMANAGER_ diff --git a/media/libdrm/mobile2/include/rights/Asset.h b/media/libdrm/mobile2/include/rights/Asset.h deleted file mode 100644 index 66696dd..0000000 --- a/media/libdrm/mobile2/include/rights/Asset.h +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef _ASSET_H -#define _ASSET_H - -#include <ustring.h> -#include <uvector.h> -#include <Drm2CommonTypes.h> -#include <rights/Right.h> -using namespace ustl; - -class Asset { -public: - /** - * Constructor for asset. - */ - Asset(); - - /** - * Destructor for asset. - */ - ~Asset(); - - /** - * Test whether asset has parent or not. - * @return true/false to indicate the result. - */ - bool hasParent(); - - /** - * Set id of asset. - * @param id the id of asset. - */ - void setID(const string &id); - - /** - * Get the id of content. - * @return asset id. - */ - const string& getID() const; - - /** - * Set contend id related to asset. - * @param id the id of content. - */ - void setContentID(const string &id); - - /** - * Get content id. - * @return content id. - */ - const string& getContentID() const; - - /** - * Set digest value of DCF. - * @param value the DCF digest value. - */ - void setDCFDigest(const string &value); - - /** - * Get the DCF digest value. - * @return the digest value of DCF. - */ - const string& getDCFDigest() const; - - /** - * Set encrypted key in asset. - * @param the encrypted key. - */ - void setEncryptedKey(const string &key); - - /** - * Get encrypted key. - * @return encypted key. - */ - const string& getEncrytedKey() const; - - /** - * Get cek. - * @return cek. - */ - const char* getCek() const; - - /** - * Set the retrieval method of key. - * @param rm the retrieval method of the key. - */ - void setKeyRetrievalMethod(const string &rm); - - /** - * Set parent content id for asset. - * @param id the parent content id. - */ - void setParentContentID(const string &id); - - /** - * Get the parent content id of the asset. - * @return the parent content id. - */ - const string& getParentContentID() const; - - /** - * Recover the CEK using private key. - */ - void recoverCek(); - -PRIVATE: - string mAssetID; - string mContentID; - string mDigestMethod; - string mDigestValue; - string mEncryptedMethod; - string mEncryptedKey; - string mRetrievalMethod; - string mParentContentID; - string mCek; -}; - -#endif diff --git a/media/libdrm/mobile2/include/rights/Constraint.h b/media/libdrm/mobile2/include/rights/Constraint.h deleted file mode 100644 index bcf5afe..0000000 --- a/media/libdrm/mobile2/include/rights/Constraint.h +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef _CONSTRAINT_H -#define _CONSTRAINT_H - -#include <Drm2CommonTypes.h> -#include <ustring.h> -#include <uvector.h> -using namespace ustl; - -struct Context { - string id; - string version; -}; - -const int INIT_VALUE = -1; - -class Constraint { -public: - enum MODE {NONE, MOVE, COPY}; /**< export mode type. */ - - /** - * Construtor for constraint. - */ - Constraint(); - - /** - * Destructor for constraint. - */ - ~Constraint(); - -public: - /** - * Test whether constraint is valid or not - * @param time the specitic time to test. - * @return true/false to indicate the result. - */ - bool isValid(long time) const; - - /** - * Test whether constraint is unconstraint or not - * @return true/false to indicate the result. - */ - bool isUnConstraint() const; - - /** - * Test whether constraint is datetime related or not. - * @return true/false to indicate the result. - */ - bool isDateTimeConstraint() const; - - /** - * Test whether constraint contain interval or not - * @return true/false to indicate the result. - */ - bool isIntervalConstraint() const; - - /** - * Test whether constraint is timed count or not - * @return true/false to indicate the result. - */ - bool isTimedCountConstraint() const; - - /** - * Set the start time value of constraint. - * @param time the specific time value. - */ - void setStartTime(long time); - - /** - * Get the start time. - * @return value of start time. - */ - long getStartTime() const; - - /** - * Set the end time. - * @param time the value of end time. - */ - void setEndTime(long time); - - /** - * Get the end time. - * @param return the value of end time. - */ - long getEndTime() const; - - /** - * Set the accumulated . - * @param time the specific time. - */ - void setAccumulated(long time); - - /** - * Get the accumulated. - * @return the value of accumulated - */ - long getAccumulated() const; - - /** - * Set the count. - * @param count the value of count. - */ - void setCount(int count); - - /** - * Get the count. - * @return value of count. - */ - int getCount() const; - - /** - * Set the value of timer. - * @param timer the value of the timer. - */ - void setTimer(int timer); - - /** - * Get the timer. - * @return value of time. - */ - int getTimer() const; - - /** - * Set the timedCount. - * @param timedCount the value of timedCount. - */ - void setTimedCount(int timedCount); - - /** - * Get the timedCount. - * @return the value of timedCount. - */ - int getTimedCount() const; - - /** - * Set the interval. - * @param interval the value of interval. - */ - void setInterval(int interval); - - /** - * Get the interval. - * @return the value of interval. - */ - int getInterval() const; - - /** - * set export mode. - * @param mode the mode type of export. - */ - void setExportMode(MODE mode); - - /** - * Get the export mode. - * @return the export mode. - */ - MODE getExportMode() const; - - /** - * Consume the constraint. - * @return true/false to indicate whether consume succesfully or not. - */ - bool consume(); - -PRIVATE: - int mCount; /**< the count. */ - int mTimedCount; /**< timed count. */ - int mTimer; /**< timer for timed count. */ - long mStart; /**< start time. */ - long mEnd; /**< end time. */ - int mInterval; /**< interval. */ - long mAccumulated; /**< accumlated. */ - vector<Context> mSystemList; /**< system list. */ - MODE mExport; /**< export mode. */ -}; -#endif diff --git a/media/libdrm/mobile2/include/rights/OperationPermission.h b/media/libdrm/mobile2/include/rights/OperationPermission.h deleted file mode 100644 index 28cba7b..0000000 --- a/media/libdrm/mobile2/include/rights/OperationPermission.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef _OPERATIONPERMISSION_H -#define _OPERATIONPERMISSION_H - -#include <Drm2CommonTypes.h> -#include <rights/Constraint.h> - -class OperationPermission { -public: - enum OPERATION {NONE, PLAY, DISPLAY, EXECUTE, PRINT, EXPORT, COMMON}; - - /** - * Construtor of OperationPermission. - */ - OperationPermission(); - - /** - * Construtor of OperationPermission. - * @param type the specific operation type. - * @param cst the constraint related with operation permission. - */ - OperationPermission(OPERATION type, Constraint* cst=NULL); - - /** - * Destrutor of OperationPermission. - */ - ~OperationPermission(); - - /** - * Set the type for operation permission. - * @param type the specific type. - */ - void setType(OPERATION type); - - /** - * Get the type of operation permission. - * @return operation type. - */ - OPERATION getType() const; - - /** - * Add constraint for operation permission. - * @param constraint the constraint related with operation permission. - */ - void addConstraint(Constraint* constraint); - - /** - * Add constraint for operation permission. - * @return constraint related with operation permission. - */ - Constraint* getConstraint() const; - -PRIVATE: - OPERATION mType; - Constraint* mConstraint; - -PRIVATE: - /** - * Disable the assignment between OperationPermissions. - */ - OperationPermission& operator=(const OperationPermission &op); - - /** - * Disable copy construtor. - */ - OperationPermission(const OperationPermission &op); -}; - -#endif diff --git a/media/libdrm/mobile2/include/rights/Right.h b/media/libdrm/mobile2/include/rights/Right.h deleted file mode 100644 index 347e484..0000000 --- a/media/libdrm/mobile2/include/rights/Right.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef _RIGHT_H -#define _RIGHT_H - -#include <Drm2CommonTypes.h> -#include <uvector.h> -#include <ustring.h> -#include <rights/Constraint.h> -#include <rights/OperationPermission.h> -using namespace ustl; - -class Right { -public: - /** - * Constructor for Right. - */ - Right(); - - /** - * Destructor for Right. - */ - ~Right(); - - /** - * Add the asset id related with right into asset name list. - * @param id the id of the asset. - */ - void addAssetID(const string& id); - - /** - * Add a operation permission into right's operation permission list. - * @param op a pointer of operation permission. - */ - void addOperationPermission(OperationPermission* op); - - /** - * Get the constraint related with operation type. - * @param type the specific operation type. - * @return NULL if not found otherwise the constraint pointer. - */ - Constraint* getConstraint(OperationPermission::OPERATION type); - - /** - * Test whether the right has specific operation type or not. - * @param type the specific type. - * @return true/false to indicate the result. - */ - bool checkPermission(OperationPermission::OPERATION type); - -public: - vector<string> mAssetNameList; - -PRIVATE: - vector<OperationPermission*> mOpList; - -PRIVATE: - - /** - * Disable the assignment between rights. - */ - Right& operator=(const Right& right); - - /** - * Disable copy constructor. - */ - Right(const Right& right); - }; - -#endif diff --git a/media/libdrm/mobile2/include/rights/Ro.h b/media/libdrm/mobile2/include/rights/Ro.h deleted file mode 100644 index 0bf0a97..0000000 --- a/media/libdrm/mobile2/include/rights/Ro.h +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _RO_H_ -#define _RO_H_ - -#include <rights/Asset.h> -#include <rights/Right.h> -#include <uvector.h> -#include <ustring.h> -#include <sistream.h> -using namespace ustl; - -class Asset; -class XMLDocumentImpl; -class XMLElementImpl; -class NodeImpl; - -class Ro { -public: - enum ERRCODE { RO_NULL_STREAM, RO_ERR_BAD_XML, RO_OK, RO_BAD }; - - /** - * Constructor for Ro. - */ - Ro(); - - /** - * Destructor for Ro. - */ - ~Ro(); - - /** - * Set id for Ro. - * @param id the id of Ro. - */ - void setRoID(string &id); - - /** - * Get the id of Ro. - * @return the id of Ro. - */ - const string& getRoID() const; - - /** - * Set version for Ro. - */ - void setRoVersion(string &version); - - /** - * Add a asset into ro's asset list. - * @param asset the pointer of asset. - */ - void addAsset(Asset* asset); - - /** - * Add a right into ro's right list. - * @param right the pointer of right. - */ - void addRight(Right* right); - - /** - * Save the Ro. - */ - bool save(); - - /** - * Verify the Ro. - */ - bool verify(); - - /** - * Parse the ro from stream. - * @param roStream the input ro stream. - * @return RO_OK if parse successfully otherwise return error code. - */ - ERRCODE parse(istringstream *roStream); - - /** - * Check the permission of the content. - * @param type the operation type. - * @param contentID the specific contentID. - * @return true/false to indicate result. - */ - bool checkPermission(OperationPermission::OPERATION type, - const string& contentID); - - /** - * Consume the right related to content. - * @param type the operation type. - * @param contentID the specific contentID. - * @return the status of consume. - */ - ERRCODE consume(OperationPermission::OPERATION type, - const string& contentID); - - /** - * Get CEK of content. - * @param contentID the specific content id. - * @return "" if not found otherwise return CEK. - */ - string getContentCek(const string& contentID); - - /** - * Get Digest value of content. - * @param contentID the specific content id. - * @return "" if not found otherwise return digest value. - */ - string getContentHash(const string& contentID); - -PRIVATE: - /** - * Handle the xml dom document. - * @param doc the pointer to the dom document. - * @return true/false to indicate the result. - */ - bool handleDocument(const XMLDocumentImpl* doc); - - /** - * Handle the xml dom node which contains <right> element. - * @param curNode the dom node which contains <right> element. - * @return true/false to indicate the result. - */ - bool handleRights(const NodeImpl *curNode); - - /** - * Handle the xml dom node which contains the <agreement> element. - * @param curNode the dom node which contains <agreement> element. - * @return true/false to indicate the result. - */ - bool handleAgreement(const NodeImpl *curNode); - - /** - * Handle the xml dom node which contains the <asset> element. - * @param curNode the dom node which contains <asset> element. - * @return true/false to indicate the result. - */ - bool handleAsset(const NodeImpl *curNode); - - /** - * Handle the xml dom node which contains the <permission> element. - * @param curNode the dom node which contains <permission> element. - * @return true/false to indicate the result. - */ - bool handlePermission(const NodeImpl *curNode); - - /** - * Get the constraint in xml dom node. - * @param curNode the dom node which contains constraint. - * @return the constraint. - */ - Constraint* getConstraint(const NodeImpl *curNode); - - /** - * Convert ISO8601 time to long. - * @param ts the string with ISO8601 time. - * @return the result value. - */ - long convertISO8601DateTimeToLong(const char* ts); - - /** - * Convert ISO8601 period to long. - * @param ts the string with ISO8601 period. - * @return the result value. - */ - long convertISO8601PeriodToLong(const char* ts); - - /** - * Load the rights related with specific contentinto content rights list. - * @param contentID the specific content id. - */ - void loadRights(const string& contentID); - - /** - * Free the current content rights list. - */ - void freeRights(); - -PRIVATE: - /** - * Disable the assignment between rights. - */ - Ro& operator=(const Ro& ro); - - /** - * Disable copy constructor. - */ - Ro(const Ro& ro); - -public: - vector<Asset*> mAssetList; - vector<Right*> mRightList; - -PRIVATE: - string mRoID; /** the Ro id. */ - string mRoVersion; /** the Ro version. */ - XMLDocumentImpl *mDoc; /**< the xml document handle. */ - vector<Right*> mContentRightList; /**< the right list to store the result related with specific content. */ - Right* mProperRight; /**< the right to consume. */ -}; -#endif diff --git a/media/libdrm/mobile2/include/rights/RoManager.h b/media/libdrm/mobile2/include/rights/RoManager.h deleted file mode 100644 index 71e9eef..0000000 --- a/media/libdrm/mobile2/include/rights/RoManager.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef _ROMANAGER_H -#define _ROMANAGER_H - -#include <Drm2CommonTypes.h> -#include <ustring.h> -#include <rights/Ro.h> - -using namespace ustl; - -class RoManager { - -public: - /** - * Singleton instance function. - * @return the singleton pointer. - */ - static RoManager* Instance(); - - /** - * Destructor for ExpatWrapper. - */ - ~RoManager(); - - /** - * Install Ro from stream. - * @param roStream the input ro stream. - * @return the status of installaltion. - */ - Ro::ERRCODE installRo(istringstream *roStream); - - /** - * Check whether Ro in cache or not. - * @param roID the specific roID. - * @return true/false to indicate result. - */ - bool checkRoInCache(const string& roID); - - /** - * Get the ro. - * @param roID the specific id of ro. - * @return NULL if not found otherwise return ro. - */ - Ro* getRo(const string& roID); - - /** - * Get all the Ro. - * @return ro list. - */ - vector<Ro*> getAllRo(); - - /** - * Get ro which contained rights of specific content. - * @param contentID the specific id of content. - * @return NULL if not fount otherwise the related ro. - */ - Ro* getRoByContentID(const string& contentID); - - /** - * Delete Ro by its id. - * @param roID the specific roID. - * @return true/false to indicate the result. - */ - bool deleteRo(const string& roID); - - -PRIVATE: - /** - * Constructor for RoManager. - */ - RoManager(); - -PRIVATE: - static RoManager* msInstance; /**< singleton instance pointer. */ - vector<Ro*> mRoList; /**< the ro list. */ -}; - -#endif diff --git a/media/libdrm/mobile2/include/roap/Registration.h b/media/libdrm/mobile2/include/roap/Registration.h deleted file mode 100644 index 0beed8e..0000000 --- a/media/libdrm/mobile2/include/roap/Registration.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef _REGISTRATION_ -#define _REGISTRATION_ - -#include <roap/RoapMessageHandler.h> - -class Registration : public RoapMessageHandler -{ -public: - /** - * Constructor for Registration. - * @param type the address of RI. - */ - Registration(string riAddres); - - /** - * Registration with the RI. - * @return the result of registration. - */ - int16_t registerWithRI(); - - /** - * Create one specified client message based on message template xml file. - * @param type the message type. - * @return the pointer of the document object of the message if successful,otherwise - * return NULL. - */ - XMLDocumentImpl* createClientMsg(int16_t type); -} -#endif _REGISTRATION_ diff --git a/media/libdrm/mobile2/include/roap/RoapMessageHandler.h b/media/libdrm/mobile2/include/roap/RoapMessageHandler.h deleted file mode 100644 index c31047f..0000000 --- a/media/libdrm/mobile2/include/roap/RoapMessageHandler.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef _ROAPMESSAGEHADLER_ -#define _ROAPMESSAGEHADLER_ - -#include <Drm2CommonTypes.h> -#include <util/xml/XMLDocumentImpl.h> - -class RoapMessageHandler -{ -public: - /** - * define all the client message types. - */ - enum msgType {DeviceHello=1,RegistrationRequest,RORequest}; - - /** - * Constructor for DrmManager,used to open local dcf file. - * @param type the message type. - */ - RoapMessageHandler(); - - /** - * Create one specified client message based on message template xml file. - * @param type the message type. - * @return the pointer of the document object of the message if successful,otherwise - * return NULL. - */ - XMLDocumentImpl* createClientMsg(msgType type); - - /** - * Handle received message from RI. - * @return true if successful, otherwise return false. - */ - bool handlePeerMsg(); - - /** - * Send the client message to RI - */ - int16_t send(); - - /** - * Receive message from RI and parse it - * @return the pointer of the parsed document. - */ - XMLDocumentImpl* receive(); - -PROTECTED: - XMLDocumentImpl * mDoc; -PRIVATE: - int16_t mMsgType; -}; -#endif //_ROAPMESSAGEHADLER_ diff --git a/media/libdrm/mobile2/include/util/crypto/DrmCrypto.h b/media/libdrm/mobile2/include/util/crypto/DrmCrypto.h deleted file mode 100644 index 10e7bc1..0000000 --- a/media/libdrm/mobile2/include/util/crypto/DrmCrypto.h +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _DRMCRYPTO_H_ -#define _DRMCRYPTO_H_ - -#include <Drm2CommonTypes.h> -#include <openssl/aes.h> -#include <openssl/hmac.h> -#include <openssl/sha.h> -#include <openssl/rsa.h> - -// AES encrypt mode -typedef enum {AES_128_CBC = 0x01,AES_128_CTR = 0x02}AesMode; - -// aes crypto for decrypt -class AesAgent -{ - public: - AesAgent(const AesMode method,const unsigned char* decryptedKey) - :mode(method),AesKey(decryptedKey){}; - - /**
- * decrypt data using AES, now only support 128 bits CBC - * \param iv 128 bits initialization vector/counter - * prefixing the ciphertext
- * \param encData encrypted data
- * \param encLen the length of encData
- * \param decData the buffer to store decrypted data
- * \param decLen the actual length of decrypted data
- * \return
- * >= succeed, the padding length
- * < 0 failed
- */ - int32_t decContent( unsigned char* iv, - const unsigned char* encData, - const unsigned long encLen, - unsigned char* decData); - static const int32_t AES_DEC_FAILED = -1; - - PRIVATE: - static const uint32_t AES_KEY_BITS = 128; - const AesMode mode; - const unsigned char* AesKey; - - PRIVATE: - // get the actual length of decrypt data
- void discardPaddingByte(unsigned char* decryptedBuf,unsigned long* decryptedBufLen);
-}; - -// Sha1 crypto for hash -class Sha1Agent -{ - public: - /**
- * compute hash using Sha1
- * \param inData the data to be hashed
- * \param inLen the length of inData
- * \param outHash the hash of inData
- * \return none
- */
- void computeHash( const unsigned char* inData,
- unsigned long inLen,
- unsigned char* outHash) const;
-
- /**
- * get the length of SHA1 hash
- * \param none
- * \return
- * the length of SHA1 hash
- */
- unsigned long getShaLen(void) const - { - return SHA_DIGEST_LENGTH; - }
-}; - -// Hmac-Sha1 crypto for MAC -class HmacSha1Agent -{ - public: - HmacSha1Agent(const unsigned char* Key, int key_len) - :macKey(Key),keyLen(key_len){}; - - /**
- * compute MAC using Hmac-Sha1
- * \param inData the data to be MAC
- * \param inLen the length of inData
- * \param outMac the MAC of inData
- * \return none
- */
- void computeMac( const unsigned char* inData,
- unsigned long inLen,
- unsigned char* outMac) const;
-
- /**
- * get the length of HMAC-SHA1 MAC
- * \param none
- * \return
- * the length of HMAC-SHA1 MAC
- */
- unsigned long getHmacLen(void) const - { - return SHA_DIGEST_LENGTH; - } -
- PRIVATE: - const unsigned char* macKey; - const int keyLen; -}; - -// Rsa crypto for signature,verify signature and key transport -class RsaAgent -{ - public: - RsaAgent(RSA& Key):rsaKey(Key) - { - rsaSize = (unsigned int)RSA_size(&Key); - }; - - // signature algorithm - typedef enum {RSA_PSS,RSA_SHA1}RsaAlg; - - /**
- * Do signature using RSA-PSS
- * \param rawData the data to be signature
- * \param rawLen the length of inData
- * \param sigData the buffer to store the signature of rawData - * \param sigAlg signature algorithm
- * \return
- * true succeed
- * false failed
- */
- bool signature( const unsigned char* rawData,
- const unsigned long rawLen,
- unsigned char* sigData, - const RsaAlg sigAlg);
-
- /**
- * get the length of signature
- * \param none
- * \return
- * the length of signature
- */
- unsigned int getSigLen(void) const - { - return rsaSize; - } - - /**
- * Verify signature using RSA-PSS
- * \param sigData the data to be verify
- * \param sigLen the length of sigData - * \param rawData the data from which the sigData generated - * \param rawLen the length of rawData - * \param sigAlg signature algorithm
- * \return
- * true succeed
- * false failed
- */
- bool sigVerify(unsigned char* sigData, - unsigned long sigLen, - const unsigned char* rawData, - const unsigned long rawLen, - const RsaAlg sigAlg); -
- - /**
- * Decrypt data using RSA
- * \param encData encrypted data
- * \param encLen the length of encData
- * \param decData the buffer to store decrypted data
- * \return
- * -1 decrypted failed
- * >0 the actual length of decrypted data
- */
- int decrypt( const unsigned char* encData,
- const unsigned long encLen,
- unsigned char* decData);
-
- /**
- * get the length of decrypted data
- * \param none
- * \return
- * the length of decrypted data
- */
- unsigned int getDecLen(void) const - { - return rsaSize; - } -
- PRIVATE: - RSA& rsaKey; - unsigned int rsaSize; -}; - - -#endif /* _DRMCRYPTO_H_ */ diff --git a/media/libdrm/mobile2/include/util/domcore/CharacterDataImpl.h b/media/libdrm/mobile2/include/util/domcore/CharacterDataImpl.h deleted file mode 100644 index d1ab31e..0000000 --- a/media/libdrm/mobile2/include/util/domcore/CharacterDataImpl.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __CHARACTER_IMPL__
-#define __CHARACTER_IMPL__
-
-#include "NodeImpl.h"
-#include "DOMString.h"
-
-class CharacterDataImpl : public NodeImpl
-{
-private:
- DOMString* charData;
-public:
-
- /**
- * Default Constructor for CharacterDataImpl.
- */
- CharacterDataImpl();
-
- /**
- * Constructor for CharacterDataImpl.
- * @param data The specify character data.
- */
- CharacterDataImpl(const DOMString* data);
-
- /**
- * The character data of the node that implements this interface. The DOM
- * implementation may not put arbitrary limits on the amount of data
- * that may be stored in a <code>CharacterData</code> node. However,
- * implementation limits may mean that the entirety of a node's data may
- * not fit into a single <code>DOMString</code>. In such cases, the user
- * may call <code>substringData</code> to retrieve the data in
- * appropriately sized pieces.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
- * @exception DOMException
- * DOMSTRING_SIZE_ERR: Raised when it would return more characters than
- * fit in a <code>DOMString</code> variable on the implementation
- * platform.
- * @return the character data.
- */
- const DOMString* getData() const throw (DOMException);
-
- /**
- * The character data of the node that implements this interface. The DOM
- * implementation may not put arbitrary limits on the amount of data
- * that may be stored in a <code>CharacterData</code> node. However,
- * implementation limits may mean that the entirety of a node's data may
- * not fit into a single <code>DOMString</code>. In such cases, the user
- * may call <code>substringData</code> to retrieve the data in
- * appropriately sized pieces.
- * @param data the specify character data.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
- * @exception DOMException
- * DOMSTRING_SIZE_ERR: Raised when it would return more characters than
- * fit in a <code>DOMString</code> variable on the implementation
- * platform.
- */
- void setData(const DOMString* data) throw (DOMException);
-
- /**
- * The number of 16-bit units that are available through <code>data</code>
- * and the <code>substringData</code> method below. This may have the
- * value zero, i.e., <code>CharacterData</code> nodes may be empty.
- * @return the size of characters data.
- */
- int getLength() const;
-
- /**
- * Append the string to the end of the character data of the node. Upon
- * success, <code>data</code> provides access to the concatenation of
- * <code>data</code> and the <code>DOMString</code> specified.
- * @param arg The <code>DOMString</code> to append.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- */
- void appendData(const DOMString* arg) throw(DOMException);
-
- /** Override getNodeValue() method in NodeImpl.h.*/
- const DOMString* getNodeValue() const throw(DOMException);
-
- /** Override setNodeValue() method in NodeImpl.h */
- void setNodeValue(DOMString* nodeValue) throw(DOMException);
-
- ~CharacterDataImpl();
-};
-#endif /*__CHARACTER_IMPL__*/
-
diff --git a/media/libdrm/mobile2/include/util/domcore/DOMException.h b/media/libdrm/mobile2/include/util/domcore/DOMException.h deleted file mode 100644 index 416519b..0000000 --- a/media/libdrm/mobile2/include/util/domcore/DOMException.h +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __DOM_EXCEPTION__
-#define __DOM_EXCEPTION__
-
-#include <uexception.h>
-using namespace ustl;
-
-/**
- * DOM operations only raise exceptions in "exceptional" circumstances, i.e.,
- * when an operation is impossible to perform (either for logical reasons, because data is lost,
- * or because the implementation has become unstable). In general, DOM methods return specific error
- * values in ordinary processing situations, such as out-of-bound errors when using <code>NodeList</code>.
- * <p>Implementations should raise other exceptions under other circumstances. For example, implementations
- * should raise an implementation-dependent exception if a null argument is passed.
- * Some languages and object systems do not support the concept of exceptions.
- * For such systems, error conditions may be indicated using native error reporting mechanisms.
- * For some bindings, for example, methods may return error codes similar to those listed in the corresponding
- * method descriptions.
- */
-class DOMException : public exception {
-
- private:
- short code;
- public:
- DOMException(short code)
- {
- this->code = code;
- }
- public:
-
- enum ExceptionReason {
- /**
- * If index or size is negative, or greater than the allowed value
- */
- INDEX_SIZE_ERR = 1,
-
- /**
- * If the specified range of text does not fit into a DOMString
- * @since http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html
- */
- DOMSTRING_SIZE_ERR = 2,
- /**
- * If any node is inserted somewhere it doesn't belong
- * @since http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html
- */
- HIERARCHY_REQUEST_ERR = 3,
-
- /**
- * If a node is used in a different document than the one that created it
- * (that doesn't support it)
- * @since http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html
- */
- WRONG_DOCUMENT_ERR = 4,
-
- /**
- * If an invalid or illegal character is specified, such as in a name. See
- * production 2 in the XML specification for the definition of a legal
- * character, and production 5 for the definition of a legal name
- * character.
- * @since http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html
- */
- INVALID_CHARACTER_ERR = 5,
-
- /**
- * If data is specified for a node which does not support data
- * @since http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html
- */
- NO_DATA_ALLOWED_ERR = 6,
-
- /**
- * If an attempt is made to modify an object where modifications are not
- * allowed
- * @since http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html
- */
- NO_MODIFICATION_ALLOWED_ERR = 7,
-
- /**
- * If an attempt is made to reference a node in a context where it does
- * not exist
- * @since http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html
- */
- NOT_FOUND_ERR = 8,
-
- /**
- * If the implementation does not support the requested type of object or
- * operation.
- * @since http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html
- */
- NOT_SUPPORTED_ERR = 9,
-
- /**
- * If an attempt is made to add an attribute that is already in use
- * elsewhere
- */
- INUSE_ATTRIBUTE_ERR = 10,
-
- /**
- * If an attempt is made to use an object that is not, or is no longer,
- * usable.
- * @since http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html
- */
- INVALID_STATE_ERR = 11,
-
- /**
- * If an invalid or illegal string is specified.
- * @since http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html
- */
- SYNTAX_ERR = 12,
-
- /**
- * If an attempt is made to modify the type of the underlying object.
- * @since http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html
- */
- INVALID_MODIFICATION_ERR = 13,
-
- /**
- * If an attempt is made to create or change an object in a way which is
- * incorrect with regard to namespaces.
- * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html
- */
- NAMESPACE_ERR = 14,
-
- /**
- * If a parameter or an operation is not supported by the underlying
- * object.
- * @since http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html
- */
- INVALID_ACCESS_ERR = 15,
- };
-public:
- /**
- * Return the exception reason.
- * @return the exception reason.
- */
- short getCode() const
- {
- return code;
- }
-};
-#endif /*__DOMEXCEPTION__*/
-
diff --git a/media/libdrm/mobile2/include/util/domcore/DOMString.h b/media/libdrm/mobile2/include/util/domcore/DOMString.h deleted file mode 100644 index f6f2b14..0000000 --- a/media/libdrm/mobile2/include/util/domcore/DOMString.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __DOM_STRING_H__
-#define __DOM_STRING_H__
-
-#include <ustring.h>
-using namespace ustl;
-typedef string DOMString;
-
-const DOMString emptyString = DOMString("");
-
-#endif /*__DOM_STRING_H_*/
-
diff --git a/media/libdrm/mobile2/include/util/domcore/DocumentImpl.h b/media/libdrm/mobile2/include/util/domcore/DocumentImpl.h deleted file mode 100644 index b003e2a..0000000 --- a/media/libdrm/mobile2/include/util/domcore/DocumentImpl.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __DOM_DOCUMENT_IMPL__
-#define __DOM_DOCUMENT_IMPL__
-#include "DOMString.h"
-#include "NodeImpl.h"
-#include "ElementImpl.h"
-#include "NodeType.h"
-#include "TextImpl.h"
-#include "NodeListImpl.h" -#include "DOMException.h"
-
-class DocumentImpl : public NodeImpl
-{
-private:
- const static DOMString nodeName;
-public:
- /**
- * Default constructor for DocumentImpl.
- */
- DocumentImpl();
- /**
- * This is a convenience attribute that allows direct access to the child
- * node that is the root element of the document. For HTML documents,
- * this is the element with the tagName "HTML".
- * @return the pointer to element.
- */
- virtual ElementImpl* getDocumentElement() const;
-
- /**
- * Creates an element of the type specified. Note that the instance
- * returned implements the <code>Element</code> interface, so attributes
- * can be specified directly on the returned object.
- * <br>In addition, if there are known attributes with default values,
- * <code>Attr</code> nodes representing them are automatically created
- * and attached to the element.
- * <br>To create an element with a qualified name and namespace URI, use
- * the <code>createElementNS</code> method.
- * @param tagName The name of the element type to instantiate. For XML,
- * this is case-sensitive. For HTML, the <code>tagName</code>
- * parameter may be provided in any case, but it must be mapped to the
- * canonical uppercase form by the DOM implementation.
- * @return A new <code>Element</code> object with the
- * <code>nodeName</code> attribute set to <code>tagName</code>, and
- * <code>localName</code>, <code>prefix</code>, and
- * <code>namespaceURI</code> set to <code>null</code>.
- * @exception DOMException
- * INVALID_CHARACTER_ERR: Raised if the specified name contains an
- * illegal character.
- */
- virtual ElementImpl* createElement(const DOMString* tagName) const throw (DOMException);
-
- /**
- * Creates a <code>Text</code> node given the specified string.
- * @param data The data for the node.
- * @return The new <code>Text</code> object.
- */
- virtual TextImpl* createTextNode(const DOMString* data) const;
-
- /**
- * Returns a <code>NodeList</code> of all the <code>Elements</code> with a
- * given tag name in the order in which they are encountered in a
- * preorder traversal of the <code>Document</code> tree.
- * @param tagname The name of the tag to match on. The special value "*"
- * matches all tags.
- * @return A new <code>NodeList</code> object containing all the matched
- * <code>Elements</code>.
- */
- NodeListImpl* getElementsByTagName(const DOMString* tagname) const;
-
- /** Override getNodeName method in NodeImpl.h.*/
- const DOMString* getNodeName() const;
-
- /** Override getNodeType method in NodeImpl.h.*/
- NodeType getNodeType() const;
-
- /**
- *
- * Event Triggered after loaded the document.
- */
- virtual bool onLoad(){return true;}
-
- /**
- *
- * Event Triggered when close or switch the document.
- */
- virtual bool onUnLoad(){return true;}
-
- ~DocumentImpl();
-};
-#endif /*__DOM_DOCUMENT_IMPL__*/
diff --git a/media/libdrm/mobile2/include/util/domcore/ElementImpl.h b/media/libdrm/mobile2/include/util/domcore/ElementImpl.h deleted file mode 100644 index 2b0bc45..0000000 --- a/media/libdrm/mobile2/include/util/domcore/ElementImpl.h +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */
-#ifndef __DOM_ELEMENT_IMPL__
-#define __DOM_ELEMENT_IMPL__
-#include "NodeImpl.h"
-#include "NodeListImpl.h"
-#include "NodeType.h"
-
-class ElementImpl : public NodeImpl
-{
-public:
-
- /**
- * The name of the element. For example, in:
- * <pre> <elementExample
- * id="demo"> ... </elementExample> , </pre>
- * <code>tagName</code> has
- * the value <code>"elementExample"</code>. Note that this is
- * case-preserving in XML, as are all of the operations of the DOM. The
- * HTML DOM returns the <code>tagName</code> of an HTML element in the
- * canonical uppercase form, regardless of the case in the source HTML
- * document.
- * @return the element's tag name.
- */
- virtual const DOMString* getTagName() const;
-
- /**
- * Retrieves an attribute value by name.
- * @param name The name of the attribute to retrieve.
- * @return The <code>Attr</code> value as a string, or the empty string
- * if that attribute does not have a specified or default value.
- */
- virtual const DOMString* getAttribute(const DOMString* name) const;
-
- /**
- * Adds a new attribute. If an attribute with that name is already present
- * in the element, its value is changed to be that of the value
- * parameter. This value is a simple string; it is not parsed as it is
- * being set. So any markup (such as syntax to be recognized as an
- * entity reference) is treated as literal text, and needs to be
- * appropriately escaped by the implementation when it is written out.
- * In order to assign an attribute value that contains entity
- * references, the user must create an <code>Attr</code> node plus any
- * <code>Text</code> and <code>EntityReference</code> nodes, build the
- * appropriate subtree, and use <code>setAttributeNode</code> to assign
- * it as the value of an attribute.
- * <br>To set an attribute with a qualified name and namespace URI, use
- * the <code>setAttributeNS</code> method.
- * @param name The name of the attribute to create or alter.
- * @param value Value to set in string form.
- * @exception DOMException
- * INVALID_CHARACTER_ERR: Raised if the specified name contains an
- * illegal character.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- */
- virtual void setAttribute(const DOMString* name, const DOMString* value) throw (DOMException);
-
- /**
- * Removes an attribute by name. If the removed attribute is known to have
- * a default value, an attribute immediately appears containing the
- * default value as well as the corresponding namespace URI, local name,
- * and prefix when applicable.
- * <br>To remove an attribute by local name and namespace URI, use the
- * <code>removeAttributeNS</code> method.
- * @param name The name of the attribute to remove.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- */
- virtual void removeAttribute(const DOMString* name) throw (DOMException);
-
- /**
- * Returns a <code>NodeList</code> of all descendant <code>Elements</code>
- * with a given tag name, in the order in which they are encountered in
- * a preorder traversal of this <code>Element</code> tree.
- * @param name The name of the tag to match on. The special value "*"
- * matches all tags.
- * @return A list of matching <code>Element</code> nodes.
- */
- NodeListImpl* getElementsByTagName(const DOMString* name) const;
-
- /** Override getNodeType() method in NodeImpl.h.*/
- virtual bool hasAttributes() const;
-
- /** Override getNodeName() method in NodeImpl.h.*/
- const DOMString* getNodeName() const;
-
- /** Override getNodeType() method in NodeImpl.h.*/
- NodeType getNodeType() const;
-
- /** Defining "click()" method*/
- virtual void click(){}
-
- /** Defining "blur()" method,*/
- virtual void blur(){}
-
- /** Defining "focus()" method*/
- virtual void focus(){}
-
- /** Defining "change()" method*/
- virtual void change(){}
-
- /** Defining "select()" method*/
- virtual void select(){}
-
- /** Defining "onClick()" event input,textarea,button, and anchor*/
- virtual bool onClick(){return true;}
-
- /** Defining "onBlur()" event,for input,textarea,button,anchor and select */
- virtual bool onBlur(){return true;}
-
- /** Defining "onFocus()" event,for input,textarea,button,anchor and select*/
- virtual bool onFocus(){return true;}
-
- /** Defining "onChange()" event,for input,textarea and select tag*/
- virtual bool onChange(){return true;}
-
- /** Defining "onSelect()" event,for textarea and input*/
- virtual bool onSelect(){return true;}
-
- /**
- * when the end tag of one element is found,this method would be called.The basic action is call seCompleted().
- **/
- virtual void endElement() {}
-
-private:
- /**
- * Get elements whose name match on <code>name</code>,than keep they into <code>nodeList</code>.
- * @param name The tag name of the elements to match on.
- * @param nodeList keep all the matched element.
- */
- void getElementsByTagName(const DOMString* name,NodeListImpl* nodeList) const;
-};
-#endif /*__DOM_ELEMENT_IMPL__*/
-
diff --git a/media/libdrm/mobile2/include/util/domcore/NodeImpl.h b/media/libdrm/mobile2/include/util/domcore/NodeImpl.h deleted file mode 100644 index 10423c3..0000000 --- a/media/libdrm/mobile2/include/util/domcore/NodeImpl.h +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __DOM_NODE_IMPL__
-#define __DOM_NODE_IMPL__
-
-#include "DOMException.h"
-#include "NodeType.h"
-#include "DOMString.h"
-class LayoutAttr;
-class DocumentImpl;
-class NodeImpl {
-private:
- /** The pointer to first children */
- NodeImpl* firstChild;
-
- /** The pointer to lastChild children */
- NodeImpl* lastChild;
-
- /** The pointer to previous sibling children */
- NodeImpl* previousSibling;
-
- /** The pointer to next sibling children */
- NodeImpl* nextSibling;
-
- /** The pointer to parent */
- NodeImpl* parent;
-
- /** Current node's document context */
- const DocumentImpl* document;
-
- /**
- * Add next slibing node
- * @param node the node to be add.
- */
- void appendNextSibling(NodeImpl* node);
-
-public:
- /**
- * Default constuctor.
- */
- NodeImpl(): firstChild(NULL),lastChild(NULL),previousSibling(NULL),nextSibling(NULL),parent(NULL),document(NULL) {};
-
- /**
- * Set <code>parentNode</code> as current node's parent.
- *
- * @param parentNode The specify parent node.
- */
- void setParent(NodeImpl* parentNode);
-
- /**
- * Set the node immediately following node.
- *
- * @param siblingNode The special node be insert after current node.
- */
- void setNextSibling(NodeImpl* siblingNode);
-
- /**
- * Returns the node immediately preceding this node.
- *
- * @param siblingNode The special node be insert before current node.
- */
- void setPreviousSibling(NodeImpl* siblingNode);
-
- /**
- * Set <code>childNode</code> as current node's first children. If current
- * node have first child node,it will replace with the <code>childNode</code>.
- *
- * @param childNode The special node be set as the first children node of current
- * node.
- */
- void setFirstChild(NodeImpl* childNode);
-
- /**
- * Set <code>childNode</code> as current node's last children. If current
- * node have last child node,it will replace with the <code>childNode</code>.
- *
- * @param childNode The special node be set as the last children node of current
- * node.
- */
- void setLastChild(NodeImpl* childNode);
-
- /**
- * The name of this node, depending on its type;
- * @return the node's name.
- */
- virtual const DOMString* getNodeName() const = 0;
-
- /**
- * The value of this node, depending on its type;
- * When it is defined to be <code>null</code>, setting it has no effect.
- * @return the value of node.
- * @exception DOMException
- * DOMSTRING_SIZE_ERR: Raised when it would return more characters than
- * fit in a <code>DOMString</code> variable on the implementation
- * platform.
- */
- virtual const DOMString* getNodeValue() const throw (DOMException);
-
- /**
- * Set the node value.
- * @param nodeValue the node value
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
- */
- virtual void setNodeValue(DOMString* nodeValue) throw (DOMException);
-
- /**
- * A code representing the type of the underlying object, as defined above.
- * @return the node's type.
- */
- virtual NodeType getNodeType() const = 0;
-
- /**
- * Returns whether this node (if it is an element) has any attributes.
- * @return <code>true</code> if this node has any attributes,
- * <code>false</code> otherwise.
- * @since DOM Level 2
- */
- virtual bool hasAttributes() const;
-
- /**
- * The parent of this node. All nodes, except <code>Attr</code>,
- * <code>Document</code>, <code>DocumentFragment</code>,
- * <code>Entity</code>, and <code>Notation</code> may have a parent.
- * However, if a node has just been created and not yet added to the
- * tree, or if it has been removed from the tree, this is
- * <code>NULL</code>.
- * @return return current node's parent.
- */
- NodeImpl* getParentNode() const;
-
- /**
- * The first child of this node. If there is no such node, this returns
- * <code>NULL</code>.
- * @return current node first children.
- */
- NodeImpl* getFirstChild() const;
-
- /**
- * The last child of this node. If there is no such node, this returns
- * <code>NULL</code>.
- * @return current node last children.
- */
- NodeImpl* getLastChild() const;
-
- /**
- * The node immediately preceding this node. If there is no such node,
- * this returns <code>NULL</code>.
- * @return current node previous sibling children.
- */
- NodeImpl* getPreviousSibling() const;
-
- /**
- * The node immediately following this node. If there is no such node,
- * this returns <code>NULL</code>.
- * @return return current node next sibling children.
- */
- NodeImpl* getNextSibling() const;
-
- /**
- * Inserts the node <code>newChild</code> before the existing child node
- * <code>refChild</code>. If <code>refChild</code> is <code>NULL</code>,
- * insert <code>newChild</code> at the end of the list of children.
- * <br>If <code>newChild</code> is a <code>DocumentFragment</code> object,
- * all of its children are inserted, in the same order, before
- * <code>refChild</code>. If the <code>newChild</code> is already in the
- * tree, it is first removed.
- * @param newChild The node to insert.
- * @param refChild The reference node, i.e., the node before which the
- * new node must be inserted.
- * @return The node being inserted.
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
- * allow children of the type of the <code>newChild</code> node, or if
- * the node to insert is one of this node's ancestors or this node
- * itself.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created
- * from a different document than the one that created this node.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly or
- * if the parent of the node being inserted is readonly.
- * <br>NOT_FOUND_ERR: Raised if <code>refChild</code> is not a child of
- * this node.
- */
- NodeImpl* insertBefore(NodeImpl* newChild, NodeImpl* refChild) throw (DOMException);
-
- /**
- * Removes the child node indicated by <code>oldChild</code> from the list
- * of children, and returns it.
- * @param oldChild The node being removed.
- * @return The node removed.
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- * <br>NOT_FOUND_ERR: Raised if <code>oldChild</code> is not a child of
- * this node.
- */
- NodeImpl* removeChild(NodeImpl* oldChild) throw (DOMException);
-
- /**
- * Adds the node <code>newChild</code> to the end of the list of children
- * of this node. If the <code>newChild</code> is already in the tree, it
- * is first removed.
- * @param newChild The node to add.If it is a
- * <code>DocumentFragment</code> object, the entire contents of the
- * document fragment are moved into the child list of this node
- * @return The node added.
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
- * allow children of the type of the <code>newChild</code> node, or if
- * the node to append is one of this node's ancestors or this node
- * itself.
- * <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created
- * from a different document than the one that created this node.
- * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly or
- * if the previous parent of the node being inserted is readonly.
- */
- NodeImpl* appendChild(NodeImpl* newChild) throw (DOMException);
-
- /**
- * Returns whether this node has any children.
- * @return <code>true</code> if this node has any children,
- * <code>false</code> otherwise.
- */
- bool hasChildNodes() const;
-
- virtual ~NodeImpl() {};
-
- /**
- * Get the LayoutAttr of this node
- * @return the pointer to LayoutAttr
- */
- virtual LayoutAttr* getLayoutAttr() const { return NULL;}
-
- /**
- * Set the LayoutAttr of this node
- * @param attr the attributes to be set
- * @return void
- */
- virtual void setLayoutAttr(LayoutAttr* attr) { return;}
-
- /**
- * Set document context.
- * @param document The specify document context.
- */
- void setDocument(const DocumentImpl* document);
-
- /**
- * Get document context.
- * @return the current node's document context.
- */
- const DocumentImpl* getDocument() const;
-};
-#endif /*__DOM_NODE_IMPL__*/
-
diff --git a/media/libdrm/mobile2/include/util/domcore/NodeIterator.h b/media/libdrm/mobile2/include/util/domcore/NodeIterator.h deleted file mode 100644 index 06fda28..0000000 --- a/media/libdrm/mobile2/include/util/domcore/NodeIterator.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __DOM_NODE_ITERATOR__
-#define __DOM_NODE_ITERATOR__
-class NodeImpl;
-/**
- * The Iterator is used to visit DOM_TREE.
- * <code>Attention</code>:The Iterator is not safe.
- * When the caller using the Iterator to access the tree,
- * the underlying data was modified, the next() or prev() may not return the right result.
- * means we have a <code>restriction</code>: the Iterator can only be used in the case that the tree structure will
- * not be modified before the end of iteration.
- */
-class NodeIterator {
-private:
- NodeImpl* scopeNode;/** The specify the range of iterating */
- NodeImpl* endNode; /** The specify the end position of iterating */
- NodeImpl* curNode; /** The position of current node.*/
-
- /**
- * Find the specify node's next order node.
- * @param node The specify node.
- * @return The next order node when success.
- * NULL when has an error.
- */
- NodeImpl* findNextOrderNode(NodeImpl* node);
-
- /**
- * Find the specify node's previous order node.
- * @param node The specify node.
- * @return The previous order node when success.
- * NULL when has an error.
- */
- NodeImpl* findPreviousOrderNode(NodeImpl* node);
-public:
- /**
- * Construct for NodeIterator.
- * we must specify <code>start</code> value when we want iterate the DOM_TREE.
- * and we also can specify the <code>scope</code> if want restrict the range of iterator.
- * (eg: restrict the range of iterating at a subtree).otherwise it will iterate the whole DOM_TREE.
- * @param start The start position.
- * @param scope The scope of iterating.
- * @param end The end position of iterating.
- */
- NodeIterator(NodeImpl* start, NodeImpl* scope = NULL, NodeImpl* end = NULL);
-
- /**
- * Get next order node at current position in DOM_TREE.
- * @return NULL On there is not node can be get.
- * The pointer of node On can get next node.
- */
- NodeImpl* next();
-
- /**
- * Get next order node at current position in DOM_TREE.
- * @return NULL On there is not node can be get.
- * The pointer of node On can get previous node.
- */
- NodeImpl* prev();
-};
-#endif /* __DOM_NODE_ITERATOR__ */
diff --git a/media/libdrm/mobile2/include/util/domcore/NodeListImpl.h b/media/libdrm/mobile2/include/util/domcore/NodeListImpl.h deleted file mode 100644 index 07c0a6a..0000000 --- a/media/libdrm/mobile2/include/util/domcore/NodeListImpl.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __NODE_LIST_IMPL__
-#define __NODE_LIST_IMPL__
-
-#include "NodeImpl.h"
-#include "Vector.h"
-class NodeListImpl {
-private:
- vector<const NodeImpl*> nodeList;
-public:
- /**
- * Add a special node into list.
- * @param newNode specify component.
- */
- void append(const NodeImpl* newNode);
-
- /**
- * Return The special position node pointer.
- * @param index The special position.
- * @return The node's pointer on success.
- * NULL when out of list's boundary.
- */
- const NodeImpl* item(int index) const;
-
- /**
- * Return the length of list.
- * @return the length of list.
- */
- int getLength() const;
-
- ~NodeListImpl();
-};
-#endif /*__NODE_LIST_IMPL__ */
-
diff --git a/media/libdrm/mobile2/include/util/domcore/NodeType.h b/media/libdrm/mobile2/include/util/domcore/NodeType.h deleted file mode 100644 index 0e51a63..0000000 --- a/media/libdrm/mobile2/include/util/domcore/NodeType.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __DOM_NODE_TYPE__
-#define __DOM_NODE_TYPE__
-enum NodeType {
- /**
- * The node is an <code>Element</code>.
- */
- ELEMENT_NODE = 1,
- /**
- * The node is an <code>Attr</code>.
- */
- ATTRIBUTE_NODE = 2,
- /**
- * The node is a <code>Text</code> node.
- */
- TEXT_NODE = 3,
- /**
- * The node type is CDATASection.
- */
- CDATA_SECTION_NODE = 4,
- /**
- * The node type is an EntityReference.
- */
- ENTITY_REFERENCE_NODE = 5,
- /**
- * The node type is an <code>Entity</code>.
- */
- ENTITY_NODE = 6,
- /**
- * The node type is a ProcessingInstruction.
- */
- PROCESSING_INSTRUCTION_NODE = 7,
- /**
- * The node is a Comment
- */
- COMMENT_NODE = 8,
- /**
- * The node is a Document.
- */
- DOCUMENT_NODE = 9,
- /**
- * The node is a DocumentType.
- */
- DOCUMENT_TYPE_NODE = 10,
- /**
- * The node is a DocumentFragment.
- */
- DOCUMENT_FRAGMENT_NODE = 11,
- /**
- * The node is a Notation.
- */
- NOTATION_NODE = 12,
-};
-#endif
diff --git a/media/libdrm/mobile2/include/util/domcore/TextImpl.h b/media/libdrm/mobile2/include/util/domcore/TextImpl.h deleted file mode 100644 index fc55fcd..0000000 --- a/media/libdrm/mobile2/include/util/domcore/TextImpl.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __DOM_TEXT_IMPL__
-#define __DOM_TEXT_IMPL__
-#include "CharacterDataImpl.h"
-class TextImpl:public CharacterDataImpl
-{
-private:
- const static DOMString nodeName;
-public:
- /** Text default constructor for TextImpl.*/
- TextImpl();
-
- /**
- * Constructor for TextImpl
- * @param data The specify data to be set.
- */
- TextImpl(const DOMString* data);
-
- /** Override getNodeType method in NodeImpl.h */
- NodeType getNodeType() const;
-
- /** Override getNodeName method in NodeImpl.h */
- const DOMString* getNodeName() const;
-};
-#endif /*__DOM_TEXT_IMPL__*/
-
diff --git a/media/libdrm/mobile2/include/util/domcore/Vector.h b/media/libdrm/mobile2/include/util/domcore/Vector.h deleted file mode 100644 index 8ceae3b..0000000 --- a/media/libdrm/mobile2/include/util/domcore/Vector.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __VECTOR_H__
-#define __VECTOR_H__
-#include <uvector.h>
-using namespace ustl;
-#endif /*__VECTOR_H__*/
-
diff --git a/media/libdrm/mobile2/include/util/domcore/stack.h b/media/libdrm/mobile2/include/util/domcore/stack.h deleted file mode 100644 index cfcf4e5..0000000 --- a/media/libdrm/mobile2/include/util/domcore/stack.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __STACK_H__
-#define __STACK_H__
-#include <ustack.h>
-using namespace ustl;
-#endif /*__STACK_H__*/
-
diff --git a/media/libdrm/mobile2/include/util/xml/DomExpatAgent.h b/media/libdrm/mobile2/include/util/xml/DomExpatAgent.h deleted file mode 100644 index 9972d5b..0000000 --- a/media/libdrm/mobile2/include/util/xml/DomExpatAgent.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */
-#ifndef _DOMEXPATAGENT_ -#define _DOMEXPATAGENT_ - -#include <Drm2CommonTypes.h> -#include <ofstream.h> -#include <sostream.h> -#include <ustring.h> -#include <sistream.h> -#include <util/domcore/NodeImpl.h> -#include <util/domcore/DOMString.h> -#include "ExpatWrapper.h" -#include "XMLElementImpl.h" -#include "XMLDocumentImpl.h" -using namespace ustl; - -class DomExpatAgent : public ExpatWrapper { -public: - /** - * Constructor for DomExpatAgent. - * @param xmlDocPtr XMLDocument pointer. - */ - DomExpatAgent(XMLDocumentImpl* xmlDocPtr); - - /** Destructor for DomExpatAgent. */ - ~DomExpatAgent(); - - /** - * Generate XML DOM Document from XML source. - * @param <code>xmlStream</code> the XML source stream. - * @return ture or false to indicate whether generate successfully. - */ - bool generateDocumentFromXML(istringstream *xmlStream); - - /** - * Generate XML stream from XML DOM document. - * @return xml stream. - */ - ostringstream* generateXMLFromDocument(); - - /** - * deal with start element in Expat. - */ - virtual void startElement(const XML_Char *name, - const XML_Char **atts); - - /** - * deal with end element for Expat. - */ - virtual void endElement(const XML_Char *name); - - /** - * deal with data handler for Expat. - */ - virtual void dataHandler(const XML_Char *s, int len); - -PRIVATE: - /** - * Push a xml element with the specific tag name into stack. - * @param name The name of tag. - * @param atts The attributes of related tag. - */ - void pushTag(const DOMString *name, const XML_Char **atts); - - /** - * Append text into top element of stack. - * @param text The data related to the present tag. - */ - void appendText(const DOMString *text); - - /** - * Pop the xml element with the specific tag name. - * @param name The name of tag. - */ - void popTag(const DOMString *name); - - /** - * Traverse the XML DOM document starting from specific element. - * @param root The specific element start to traverse. - */ - void traverse(ElementImpl *root); - -PRIVATE: - vector<NodeImpl*> mStack; /**< the stack to manage the tag. */ - XMLElementImpl* mTopElementPtr; /**< the top element of the stack. */ - XMLDocumentImpl* mXMLDocumentPtr; /**< XML DOM document pointer. */ - ostringstream mXMLostream; /**< xml output stream. */ -}; - -#endif diff --git a/media/libdrm/mobile2/include/util/xml/ExpatWrapper.h b/media/libdrm/mobile2/include/util/xml/ExpatWrapper.h deleted file mode 100644 index 5a2d7fe..0000000 --- a/media/libdrm/mobile2/include/util/xml/ExpatWrapper.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */
-#ifndef _XML_H_ -#define _XML_H_ - -#include <expat.h> -#include <ustring.h> -#include <Drm2CommonTypes.h> - -using namespace ustl; - -class ExpatWrapper { -public: - /** - * Constructor for ExpatWrapper. - */ - ExpatWrapper(); - - /** - * Destructor for ExpatWrapper. - */ - virtual ~ExpatWrapper(); - - /** - * decode call expat to parse the xml. - * @param buf The buffer to be parsed. - * @param len The length of the buffer. - * @param isFinal The flag to indicate whether the buffer - * is a fragment or whole xml. - */ - int decode(const char* buf, int len, int isFinal); - - /** - * virtual funtion to deal with the start element in expat, need implement by child class. - */ - virtual void startElement(const XML_Char *name, const XML_Char **atts); - - /** - * virtual funtion to deal with the end element in expat, need implement by child class. - */ - virtual void endElement(const XML_Char *name); - - /** - * virtual funtion to deal with the data handler in expat, need implement by child class. - */ - virtual void dataHandler(const XML_Char *s, int len); - -PRIVATE: - /** - * Callback for Expat startElement. - */ - static void startElementCallback(void *userData, const XML_Char *name, const XML_Char **atts); - - /** - * Callback for Expat endElement. - */ - static void endElementCallback(void *userData, const XML_Char *name); - - /** - * Callback for Expat dataHandler. - */ - static void dataHandlerCallback(void *userData, const XML_Char *s, int len); - -PRIVATE: - XML_Parser mParser; /**< The expat parser object. */ -}; - -#endif diff --git a/media/libdrm/mobile2/include/util/xml/XMLDocumentImpl.h b/media/libdrm/mobile2/include/util/xml/XMLDocumentImpl.h deleted file mode 100644 index c29b87d..0000000 --- a/media/libdrm/mobile2/include/util/xml/XMLDocumentImpl.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */
-#ifndef _XMLDOCUMENTIMPL_H_ -#define _XMLDOCUMENTIMPL_H_ - -#include <Drm2CommonTypes.h> -#include <util/domcore/DocumentImpl.h> - -class XMLDocumentImpl : public DocumentImpl { -public: - /** Constructor for XMLDocumentImpl. */ - XMLDocumentImpl(); - - /** Destructor for XMLDocumentImpl. */ - ~XMLDocumentImpl(); - - /** - * Get the first child element of the document. - * @return the first child <code>Element</code> of document. - */ - virtual ElementImpl* getDocumentElement() const; - - /** - * Create a XML element with the specific name. - * @param tagName The specific tag name. - * @return a new xml <code>Element</code> - * @exception DOMException - */ - virtual ElementImpl* createElement(const DOMString* tagName) const throw (DOMException); - - /** - * Create a text node with the specific data. - * @param data The specific data. - * @return a new <code>Text</code> node. - */ - virtual TextImpl* createTextNode(const DOMString* data) const; -}; - -#endif diff --git a/media/libdrm/mobile2/include/util/xml/XMLElementImpl.h b/media/libdrm/mobile2/include/util/xml/XMLElementImpl.h deleted file mode 100644 index a0c95ec..0000000 --- a/media/libdrm/mobile2/include/util/xml/XMLElementImpl.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */
-#ifndef _XMLELEMENTIMPL_H_ -#define _XMLELEMENTIMPL_H_ - -#include <Drm2CommonTypes.h> -#include <util/domcore/ElementImpl.h> -#include <util/domcore/DOMString.h> -#include <umap.h> -#include <ustring.h> -using namespace ustl; - -typedef map<DOMString, DOMString> DOMStringMap; - -class XMLElementImpl : public ElementImpl { -public: - /** - * Constructor for XMLElementImpl. - * @param tag The name of the tag. - */ - XMLElementImpl(const DOMString *tag); - - /** Destructor for XMLElementImpl. */ - ~XMLElementImpl(); - - /** - * Get the attribute map of the XML element. - * @return <code>DOMStringMap</code> - */ - const DOMStringMap* getAttributeMap() const; - - /** - * Get the tag name of the element. - * return tag name. - */ - virtual const DOMString* getTagName() const; - - /** - * Set the attribute of the element. - * @param name The key of the attribute. - * @param value The value of the attribute. - */ - virtual void setAttribute(const DOMString* name, const DOMString* value) throw (DOMException); - - /** - * Remove the specific attribute. - * @param name The key of the attribute. - * @exception DOMException. - */ - virtual void removeAttribute(const DOMString* name) throw (DOMException); - - /** - * Get the specific attribute. - * @param name The key of the attribute. - * @return the value of the attribute. - */ - virtual const DOMString* getAttribute(const DOMString* name) const; - - /** - * Detect whether element has attributes or not. - * @return true or false to indicate the result. - */ - virtual bool hasAttributes() const; - - /** - * Find the first child node in element by its tag name. - * @param element the specific element to be found. - * @param tag the specific tag name to be searched. - * @return NULL if not found otherwise the child node. - */ - const NodeImpl* findSoloChildNode(const char* tag) const; - - /** - * Get the first text containted in first child of the element. - * @param tag the specific tag name to be searched. - * @return NULL if not found otherwise the text. - */ - const string* getSoloText(const char* tag) const; - - /** - * Get the first child xml element containted in the element. - * @param tag the specific tag name to be searched. - * @return NULL if not found otherwise the element. - */ - const XMLElementImpl* getSoloElement(const char* tag) const; - -PRIVATE: - DOMString mTagName; /**< The tag name. */ - DOMStringMap mAttributeMap; /** The map of attributes. */ -}; - -#endif |