feat: update wfassoc c/c++ bindings
This commit is contained in:
@@ -24,8 +24,16 @@
|
|||||||
*/
|
*/
|
||||||
namespace wfassocpp {
|
namespace wfassocpp {
|
||||||
|
|
||||||
/** @brief Type representing a null-terminated UTF-8 C-style string */
|
/** @brief Type representing a pointer to a null-terminated UTF-8 C-style string */
|
||||||
using CString = wfassoc::WFCString;
|
using StrPtr = wfassoc::WFStrPtr;
|
||||||
|
/**
|
||||||
|
* @brief Type representing an error code returned by FFI functions
|
||||||
|
*
|
||||||
|
* WFERROR_OK is the only value representing absolute success.
|
||||||
|
* Any other value's meaning is decided by this library,
|
||||||
|
* currently WFERROR_ERR represents a generic failure.
|
||||||
|
*/
|
||||||
|
using Error = wfassoc::WFError;
|
||||||
/**
|
/**
|
||||||
* @brief Type representing a handle/token for managed objects
|
* @brief Type representing a handle/token for managed objects
|
||||||
*
|
*
|
||||||
@@ -39,10 +47,12 @@ using Token = wfassoc::WFToken;
|
|||||||
* This type is equivalent to the Win32 HICON type.
|
* This type is equivalent to the Win32 HICON type.
|
||||||
*/
|
*/
|
||||||
using HICON = wfassoc::WFHICON;
|
using HICON = wfassoc::WFHICON;
|
||||||
|
/** @brief Invalid token value used as a sentinel for no object */
|
||||||
|
constexpr Token INVALID_TOKEN = wfassoc::WF_INVALID_TOKEN;
|
||||||
/** @brief Invalid icon handle value */
|
/** @brief Invalid icon handle value */
|
||||||
using INVALID_HICON = wfassoc::WF_INVALID_HICON;
|
constexpr HICON INVALID_HICON = wfassoc::WF_INVALID_HICON;
|
||||||
/** @brief Invalid index value used for error conditions */
|
/** @brief Invalid index value used for error conditions */
|
||||||
using INVALID_INDEX = wfassoc::WF_INVALID_INDEX;
|
constexpr size_t INVALID_INDEX = wfassoc::WF_INVALID_INDEX;
|
||||||
/**
|
/**
|
||||||
* @brief Registration scope for file associations
|
* @brief Registration scope for file associations
|
||||||
*
|
*
|
||||||
@@ -60,30 +70,15 @@ using View = wfassoc::WFView;
|
|||||||
* @private
|
* @private
|
||||||
* @brief Check the result of a C API call and throw on failure
|
* @brief Check the result of a C API call and throw on failure
|
||||||
*
|
*
|
||||||
* @param[in] result Boolean result from a C API call
|
* @param[in] result Error code returned from a C API call
|
||||||
* @throws std::runtime_error if result is false, with the error message from WFGetLastError()
|
* @throws std::runtime_error if result is not WFERROR_OK, with the error message from WFGetLastError()
|
||||||
*/
|
*/
|
||||||
inline void _Check(bool result) {
|
inline void _Check(wfassoc::WFError result) {
|
||||||
if (!result) {
|
if (result != wfassoc::WFERROR_OK) {
|
||||||
throw std::runtime_error(wfassoc::WFGetLastError());
|
throw std::runtime_error(wfassoc::WFGetLastError());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @private
|
|
||||||
* @brief Get the invalid token value
|
|
||||||
*
|
|
||||||
* In theory, invalid token value should be a constant value.
|
|
||||||
* However, due to the library used in Rust side, this value can only be fetched at runtime.
|
|
||||||
* This function caches the value on first call for subsequent use.
|
|
||||||
*
|
|
||||||
* @return An invalid token value
|
|
||||||
*/
|
|
||||||
inline Token _INVALID_TOKEN() {
|
|
||||||
static Token v = wfassoc::WFInvalidToken();
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Schema object for defining a program's file association configuration
|
* @brief Schema object for defining a program's file association configuration
|
||||||
*
|
*
|
||||||
@@ -106,7 +101,7 @@ public:
|
|||||||
* Releases resources associated with the Schema object.
|
* Releases resources associated with the Schema object.
|
||||||
*/
|
*/
|
||||||
~Schema() {
|
~Schema() {
|
||||||
if (_token != _INVALID_TOKEN()) {
|
if (_token != INVALID_TOKEN) {
|
||||||
wfassoc::WFSchemaDestroy(_token);
|
wfassoc::WFSchemaDestroy(_token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -117,15 +112,15 @@ public:
|
|||||||
Schema& operator=(const Schema&) = delete;
|
Schema& operator=(const Schema&) = delete;
|
||||||
|
|
||||||
/** @brief Move constructor */
|
/** @brief Move constructor */
|
||||||
Schema(Schema&& other) noexcept : _token(other._token) { other._token = _INVALID_TOKEN(); }
|
Schema(Schema&& other) noexcept : _token(other._token) { other._token = INVALID_TOKEN; }
|
||||||
/** @brief Move assignment operator */
|
/** @brief Move assignment operator */
|
||||||
Schema& operator=(Schema&& other) noexcept {
|
Schema& operator=(Schema&& other) noexcept {
|
||||||
if (this != &other) {
|
if (this != &other) {
|
||||||
if (_token != _INVALID_TOKEN()) {
|
if (_token != INVALID_TOKEN) {
|
||||||
wfassoc::WFSchemaDestroy(_token);
|
wfassoc::WFSchemaDestroy(_token);
|
||||||
}
|
}
|
||||||
_token = other._token;
|
_token = other._token;
|
||||||
other._token = _INVALID_TOKEN();
|
other._token = INVALID_TOKEN;
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -240,7 +235,7 @@ private:
|
|||||||
*/
|
*/
|
||||||
Token Release() noexcept {
|
Token Release() noexcept {
|
||||||
Token t = _token;
|
Token t = _token;
|
||||||
_token = _INVALID_TOKEN();
|
_token = INVALID_TOKEN;
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -270,7 +265,7 @@ public:
|
|||||||
* Releases resources associated with the icon resource.
|
* Releases resources associated with the icon resource.
|
||||||
*/
|
*/
|
||||||
~IconRc() {
|
~IconRc() {
|
||||||
if (_token != _INVALID_TOKEN()) {
|
if (_token != INVALID_TOKEN) {
|
||||||
wfassoc::WFIconRcDestroy(_token);
|
wfassoc::WFIconRcDestroy(_token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -281,15 +276,15 @@ public:
|
|||||||
IconRc& operator=(const IconRc&) = delete;
|
IconRc& operator=(const IconRc&) = delete;
|
||||||
|
|
||||||
/** @brief Move constructor */
|
/** @brief Move constructor */
|
||||||
IconRc(IconRc&& other) noexcept : _token(other._token) { other._token = _INVALID_TOKEN(); }
|
IconRc(IconRc&& other) noexcept : _token(other._token) { other._token = INVALID_TOKEN; }
|
||||||
/** @brief Move assignment operator */
|
/** @brief Move assignment operator */
|
||||||
IconRc& operator=(IconRc&& other) noexcept {
|
IconRc& operator=(IconRc&& other) noexcept {
|
||||||
if (this != &other) {
|
if (this != &other) {
|
||||||
if (_token != _INVALID_TOKEN()) {
|
if (_token != INVALID_TOKEN) {
|
||||||
wfassoc::WFIconRcDestroy(_token);
|
wfassoc::WFIconRcDestroy(_token);
|
||||||
}
|
}
|
||||||
_token = other._token;
|
_token = other._token;
|
||||||
other._token = _INVALID_TOKEN();
|
other._token = INVALID_TOKEN;
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -334,7 +329,7 @@ public:
|
|||||||
* Releases resources associated with the extension status.
|
* Releases resources associated with the extension status.
|
||||||
*/
|
*/
|
||||||
~ExtStatus() {
|
~ExtStatus() {
|
||||||
if (_token != _INVALID_TOKEN()) {
|
if (_token != INVALID_TOKEN) {
|
||||||
wfassoc::WFExtStatusDestroy(_token);
|
wfassoc::WFExtStatusDestroy(_token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -345,15 +340,15 @@ public:
|
|||||||
ExtStatus& operator=(const ExtStatus&) = delete;
|
ExtStatus& operator=(const ExtStatus&) = delete;
|
||||||
|
|
||||||
/** @brief Move constructor */
|
/** @brief Move constructor */
|
||||||
ExtStatus(ExtStatus&& other) noexcept : _token(other._token) { other._token = _INVALID_TOKEN(); }
|
ExtStatus(ExtStatus&& other) noexcept : _token(other._token) { other._token = INVALID_TOKEN; }
|
||||||
/** @brief Move assignment operator */
|
/** @brief Move assignment operator */
|
||||||
ExtStatus& operator=(ExtStatus&& other) noexcept {
|
ExtStatus& operator=(ExtStatus&& other) noexcept {
|
||||||
if (this != &other) {
|
if (this != &other) {
|
||||||
if (_token != _INVALID_TOKEN()) {
|
if (_token != INVALID_TOKEN) {
|
||||||
wfassoc::WFExtStatusDestroy(_token);
|
wfassoc::WFExtStatusDestroy(_token);
|
||||||
}
|
}
|
||||||
_token = other._token;
|
_token = other._token;
|
||||||
other._token = _INVALID_TOKEN();
|
other._token = INVALID_TOKEN;
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -415,7 +410,7 @@ public:
|
|||||||
* Releases resources associated with the self extension status.
|
* Releases resources associated with the self extension status.
|
||||||
*/
|
*/
|
||||||
~SelfExtStatus() {
|
~SelfExtStatus() {
|
||||||
if (_token != _INVALID_TOKEN()) {
|
if (_token != INVALID_TOKEN) {
|
||||||
wfassoc::WFSelfExtStatusDestroy(_token);
|
wfassoc::WFSelfExtStatusDestroy(_token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -426,15 +421,15 @@ public:
|
|||||||
SelfExtStatus& operator=(const SelfExtStatus&) = delete;
|
SelfExtStatus& operator=(const SelfExtStatus&) = delete;
|
||||||
|
|
||||||
/** @brief Move constructor */
|
/** @brief Move constructor */
|
||||||
SelfExtStatus(SelfExtStatus&& other) noexcept : _token(other._token) { other._token = _INVALID_TOKEN(); }
|
SelfExtStatus(SelfExtStatus&& other) noexcept : _token(other._token) { other._token = INVALID_TOKEN; }
|
||||||
/** @brief Move assignment operator */
|
/** @brief Move assignment operator */
|
||||||
SelfExtStatus& operator=(SelfExtStatus&& other) noexcept {
|
SelfExtStatus& operator=(SelfExtStatus&& other) noexcept {
|
||||||
if (this != &other) {
|
if (this != &other) {
|
||||||
if (_token != _INVALID_TOKEN()) {
|
if (_token != INVALID_TOKEN) {
|
||||||
wfassoc::WFSelfExtStatusDestroy(_token);
|
wfassoc::WFSelfExtStatusDestroy(_token);
|
||||||
}
|
}
|
||||||
_token = other._token;
|
_token = other._token;
|
||||||
other._token = _INVALID_TOKEN();
|
other._token = INVALID_TOKEN;
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -525,7 +520,7 @@ public:
|
|||||||
* Releases resources associated with the Program.
|
* Releases resources associated with the Program.
|
||||||
*/
|
*/
|
||||||
~Program() {
|
~Program() {
|
||||||
if (_token != _INVALID_TOKEN()) {
|
if (_token != INVALID_TOKEN) {
|
||||||
wfassoc::WFProgramDestroy(_token);
|
wfassoc::WFProgramDestroy(_token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -536,15 +531,15 @@ public:
|
|||||||
Program& operator=(const Program&) = delete;
|
Program& operator=(const Program&) = delete;
|
||||||
|
|
||||||
/** @brief Move constructor */
|
/** @brief Move constructor */
|
||||||
Program(Program&& other) noexcept : _token(other._token) { other._token = _INVALID_TOKEN(); }
|
Program(Program&& other) noexcept : _token(other._token) { other._token = INVALID_TOKEN; }
|
||||||
/** @brief Move assignment operator */
|
/** @brief Move assignment operator */
|
||||||
Program& operator=(Program&& other) noexcept {
|
Program& operator=(Program&& other) noexcept {
|
||||||
if (this != &other) {
|
if (this != &other) {
|
||||||
if (_token != _INVALID_TOKEN()) {
|
if (_token != INVALID_TOKEN) {
|
||||||
wfassoc::WFProgramDestroy(_token);
|
wfassoc::WFProgramDestroy(_token);
|
||||||
}
|
}
|
||||||
_token = other._token;
|
_token = other._token;
|
||||||
other._token = _INVALID_TOKEN();
|
other._token = INVALID_TOKEN;
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -576,7 +571,7 @@ public:
|
|||||||
* @throws std::runtime_error if the operation fails
|
* @throws std::runtime_error if the operation fails
|
||||||
*/
|
*/
|
||||||
IconRc ResolveIcon() {
|
IconRc ResolveIcon() {
|
||||||
Token token = _INVALID_TOKEN();
|
Token token = INVALID_TOKEN;
|
||||||
_Check(wfassoc::WFProgramResolveIcon(_token, &token));
|
_Check(wfassoc::WFProgramResolveIcon(_token, &token));
|
||||||
return IconRc(token);
|
return IconRc(token);
|
||||||
}
|
}
|
||||||
@@ -614,7 +609,7 @@ public:
|
|||||||
* @throws std::runtime_error if the operation fails
|
* @throws std::runtime_error if the operation fails
|
||||||
*/
|
*/
|
||||||
SelfExtStatus ResolveExt(size_t index) {
|
SelfExtStatus ResolveExt(size_t index) {
|
||||||
Token token = _INVALID_TOKEN();
|
Token token = INVALID_TOKEN;
|
||||||
_Check(wfassoc::WFProgramResolveExt(_token, index, &token));
|
_Check(wfassoc::WFProgramResolveExt(_token, index, &token));
|
||||||
return SelfExtStatus(token);
|
return SelfExtStatus(token);
|
||||||
}
|
}
|
||||||
@@ -676,9 +671,9 @@ public:
|
|||||||
* @throws std::runtime_error if the operation fails
|
* @throws std::runtime_error if the operation fails
|
||||||
*/
|
*/
|
||||||
std::optional<ExtStatus> QueryExt(View view, size_t index) {
|
std::optional<ExtStatus> QueryExt(View view, size_t index) {
|
||||||
Token token = _INVALID_TOKEN();
|
Token token = INVALID_TOKEN;
|
||||||
_Check(wfassoc::WFProgramQueryExt(_token, view, index, &token));
|
_Check(wfassoc::WFProgramQueryExt(_token, view, index, &token));
|
||||||
if (token == _INVALID_TOKEN()) {
|
if (token == INVALID_TOKEN) {
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
return ExtStatus(token);
|
return ExtStatus(token);
|
||||||
|
|||||||
+101
-123
@@ -34,7 +34,15 @@ namespace wfassoc {
|
|||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
/** Type representing a null-terminated UTF-8 C-style string */
|
/** Type representing a null-terminated UTF-8 C-style string */
|
||||||
using WFCString = const char*;
|
using WFStrPtr = const char*;
|
||||||
|
/**
|
||||||
|
* @brief Type representing an error code returned by FFI functions
|
||||||
|
*
|
||||||
|
* WFERROR_OK is the only value representing absolute success.
|
||||||
|
* Any other value's meaning is decided by this library,
|
||||||
|
* currently WFERROR_ERR represents a generic failure.
|
||||||
|
*/
|
||||||
|
using WFError = uint32_t;
|
||||||
/**
|
/**
|
||||||
* @brief Type representing a handle/token for managed objects
|
* @brief Type representing a handle/token for managed objects
|
||||||
*
|
*
|
||||||
@@ -49,18 +57,28 @@ using WFToken = uint64_t;
|
|||||||
*/
|
*/
|
||||||
using WFHICON = void*;
|
using WFHICON = void*;
|
||||||
#else // __cplusplus
|
#else // __cplusplus
|
||||||
typedef const char *WFCString;
|
typedef const char *WFStrPtr;
|
||||||
|
typedef uint32_t WFError;
|
||||||
typedef uint64_t WFToken;
|
typedef uint64_t WFToken;
|
||||||
typedef void *WFHICON;
|
typedef void *WFHICON;
|
||||||
#endif // __cplusplus
|
#endif // __cplusplus
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
/** The error code representing absolute success. */
|
||||||
|
constexpr WFError WFERROR_OK = 0u;
|
||||||
|
/** The error code representing a generic failure. */
|
||||||
|
constexpr WFError WFERROR_ERR = 1u;
|
||||||
|
/** Invalid token value used as a sentinel for no object */
|
||||||
|
constexpr WFToken WF_INVALID_TOKEN = 0u;
|
||||||
/** Invalid icon handle value */
|
/** Invalid icon handle value */
|
||||||
constexpr WFHICON WF_INVALID_HICON = nullptr;
|
constexpr WFHICON WF_INVALID_HICON = nullptr;
|
||||||
/** Invalid index value used for error conditions */
|
/** Invalid index value used for error conditions */
|
||||||
constexpr size_t WF_INVALID_INDEX = static_cast<size_t>(-1);
|
constexpr size_t WF_INVALID_INDEX = static_cast<size_t>(-1);
|
||||||
#else // __cplusplus
|
#else // __cplusplus
|
||||||
|
static const WFError WFERROR_OK = 0u;
|
||||||
|
static const WFError WFERROR_ERR = 1u;
|
||||||
|
static const WFToken WF_INVALID_TOKEN = 0u;
|
||||||
static const WFHICON WF_INVALID_HICON = NULL;
|
static const WFHICON WF_INVALID_HICON = NULL;
|
||||||
static const size_t WF_INVALID_INDEX = ((size_t)-1);
|
static const size_t WF_INVALID_INDEX = ((size_t)-1);
|
||||||
#endif // __cplusplus
|
#endif // __cplusplus
|
||||||
@@ -111,25 +129,6 @@ static const WFView WF_VIEW_HYBRID = 2u;
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif // __cplusplus
|
#endif // __cplusplus
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Initialize the wfassoc library
|
|
||||||
*
|
|
||||||
* This function must be called before using the MOST of any other wfassoc functions.
|
|
||||||
*
|
|
||||||
* @return true on success, false on failure.
|
|
||||||
*/
|
|
||||||
bool WFStartup(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Shutdown the wfassoc library
|
|
||||||
*
|
|
||||||
* Cleans up all allocated resources and object pools.
|
|
||||||
* Should be called when done using the library.
|
|
||||||
*
|
|
||||||
* @return true on success, false on failure.
|
|
||||||
*/
|
|
||||||
bool WFShutdown(void);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the last error message
|
* @brief Get the last error message
|
||||||
*
|
*
|
||||||
@@ -137,46 +136,25 @@ bool WFShutdown(void);
|
|||||||
* The returned error message string is valid until the next API call.
|
* The returned error message string is valid until the next API call.
|
||||||
*
|
*
|
||||||
* For most functions located in this library, except some special function indicated in their notes,
|
* For most functions located in this library, except some special function indicated in their notes,
|
||||||
* they return boolean value indicating whether function is successful or not.
|
* they return WFERROR_OK when the function is successful, and WFERROR_ERR when the function is failed.
|
||||||
* Once they fail, you can call this function to get a human-readable error message.
|
* Once they fail, you can call this function to get a human-readable error message.
|
||||||
*
|
*
|
||||||
* The execution of this function do not need to be wrapped by WFStartup() and WFShutdown().
|
|
||||||
*
|
|
||||||
* The string this function return use different buffer with function return string value.
|
* The string this function return use different buffer with function return string value.
|
||||||
* So you don't worry about that calling this function may invalidate function function return string value.
|
* So you don't worry about that calling this function may invalidate function return string value.
|
||||||
*
|
*
|
||||||
* @return Null-terminated UTF-8 string containing the error message.
|
* @return Null-terminated UTF-8 string containing the error message.
|
||||||
* If no error has occurred, the string is empty.
|
* If no error has occurred, the string is empty.
|
||||||
* There is no possibility of a NULL return value.
|
* There is no possibility of a NULL return value.
|
||||||
*/
|
*/
|
||||||
WFCString WFGetLastError(void);
|
WFStrPtr WFGetLastError(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Check if the current process has administrative privileges
|
* @brief Check if the current process has administrative privileges
|
||||||
*
|
*
|
||||||
* This function will not throw any error.
|
* @param[out] out_has Pointer to receive whether the current process has administrative privileges.
|
||||||
* There is no necessity to call WFGetLastError() after this function.
|
* @return WFERROR_OK on success, WFERROR_ERR on failure.
|
||||||
* The return value only indicates whether the current process has administrative privileges or not.
|
|
||||||
*
|
|
||||||
* The execution of this function do not need to be wrapped by WFStartup() and WFShutdown().
|
|
||||||
*
|
|
||||||
* @return true if running with admin privileges, false otherwise
|
|
||||||
*/
|
*/
|
||||||
bool WFHasPrivilege(void);
|
WFError WFHasPrivilege(bool *out_has);
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Get an invalid token value
|
|
||||||
*
|
|
||||||
* In theory, invalid token value should be a constant value.
|
|
||||||
* However, due to the library I used in Rust side, this value only can be fetched at runtime.
|
|
||||||
* So I expose this function to make programmer can fetch this constant value.
|
|
||||||
* Theoretically, you just need to fetch this function only once at the beginning of your program.
|
|
||||||
*
|
|
||||||
* The execution of this function do not need to be wrapped by WFStartup() and WFShutdown().
|
|
||||||
*
|
|
||||||
* @return An invalid token value
|
|
||||||
*/
|
|
||||||
WFToken WFInvalidWFToken(void);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Create a new Schema object
|
* @brief Create a new Schema object
|
||||||
@@ -189,9 +167,9 @@ WFToken WFInvalidWFToken(void);
|
|||||||
* The receiver take the ownership of this Schema object.
|
* The receiver take the ownership of this Schema object.
|
||||||
* And it should be freed by calling WFSchemaDestroy() when it is no longer needed,
|
* And it should be freed by calling WFSchemaDestroy() when it is no longer needed,
|
||||||
* or consumed by creating a Program object via WFProgramCreate().
|
* or consumed by creating a Program object via WFProgramCreate().
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFSchemaCreate(WFToken *out_schema);
|
WFError WFSchemaCreate(WFToken *out_schema);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Destroy a Schema object
|
* @brief Destroy a Schema object
|
||||||
@@ -202,9 +180,9 @@ bool WFSchemaCreate(WFToken *out_schema);
|
|||||||
* because the convertion function from Schema to Program will consume given Schema object to produce Program object.
|
* because the convertion function from Schema to Program will consume given Schema object to produce Program object.
|
||||||
*
|
*
|
||||||
* @param[in] in_schema Schema token to destroy
|
* @param[in] in_schema Schema token to destroy
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFSchemaDestroy(WFToken in_schema);
|
WFError WFSchemaDestroy(WFToken in_schema);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set the program identifier for a Schema
|
* @brief Set the program identifier for a Schema
|
||||||
@@ -213,9 +191,9 @@ bool WFSchemaDestroy(WFToken in_schema);
|
|||||||
* @param[in] in_value Null-terminated UTF-8 string containing the identifier.
|
* @param[in] in_value Null-terminated UTF-8 string containing the identifier.
|
||||||
* This identifier should not be empty, must start with alphabet character,
|
* This identifier should not be empty, must start with alphabet character,
|
||||||
* and follow with alphabet characters, digits, underline, or hyphens.
|
* and follow with alphabet characters, digits, underline, or hyphens.
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFSchemaSetIdentifier(WFToken in_schema, WFCString in_value);
|
WFError WFSchemaSetIdentifier(WFToken in_schema, WFStrPtr in_value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set the program path for a Schema
|
* @brief Set the program path for a Schema
|
||||||
@@ -223,9 +201,9 @@ bool WFSchemaSetIdentifier(WFToken in_schema, WFCString in_value);
|
|||||||
* @param[in] in_schema Schema token
|
* @param[in] in_schema Schema token
|
||||||
* @param[in] in_value Null-terminated UTF-8 string containing the program path.
|
* @param[in] in_value Null-terminated UTF-8 string containing the program path.
|
||||||
* This path should be the fully qualified path to the application.
|
* This path should be the fully qualified path to the application.
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFSchemaSetPath(WFToken in_schema, WFCString in_value);
|
WFError WFSchemaSetPath(WFToken in_schema, WFStrPtr in_value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set the program CLSID for a Schema
|
* @brief Set the program CLSID for a Schema
|
||||||
@@ -234,36 +212,36 @@ bool WFSchemaSetPath(WFToken in_schema, WFCString in_value);
|
|||||||
* @param[in] in_value Null-terminated UTF-8 string containing the CLSID.
|
* @param[in] in_value Null-terminated UTF-8 string containing the CLSID.
|
||||||
* This CLSID string should be in the format of @c {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} .
|
* This CLSID string should be in the format of @c {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} .
|
||||||
* Please note that curly braces are required.
|
* Please note that curly braces are required.
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFSchemaSetClsid(WFToken in_schema, WFCString in_value);
|
WFError WFSchemaSetClsid(WFToken in_schema, WFStrPtr in_value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set the program name for a Schema (optional)
|
* @brief Set the program name for a Schema (optional)
|
||||||
*
|
*
|
||||||
* @param[in] in_schema Schema token
|
* @param[in] in_schema Schema token
|
||||||
* @param[in] in_value Null-terminated UTF-8 string containing the name, or NULL to clear
|
* @param[in] in_value Null-terminated UTF-8 string containing the name, or NULL to clear
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFSchemaSetName(WFToken in_schema, WFCString in_value);
|
WFError WFSchemaSetName(WFToken in_schema, WFStrPtr in_value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set the program icon for a Schema (optional)
|
* @brief Set the program icon for a Schema (optional)
|
||||||
*
|
*
|
||||||
* @param[in] in_schema Schema token
|
* @param[in] in_schema Schema token
|
||||||
* @param[in] in_value Null-terminated UTF-8 string containing the icon path, or NULL to clear
|
* @param[in] in_value Null-terminated UTF-8 string containing the icon path, or NULL to clear
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFSchemaSetIcon(WFToken in_schema, WFCString in_value);
|
WFError WFSchemaSetIcon(WFToken in_schema, WFStrPtr in_value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set the program behavior for a Schema (optional)
|
* @brief Set the program behavior for a Schema (optional)
|
||||||
*
|
*
|
||||||
* @param[in] in_schema Schema token
|
* @param[in] in_schema Schema token
|
||||||
* @param[in] in_value Null-terminated UTF-8 string containing the behavior command, or NULL to clear
|
* @param[in] in_value Null-terminated UTF-8 string containing the behavior command, or NULL to clear
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFSchemaSetBehavior(WFToken in_schema, WFCString in_value);
|
WFError WFSchemaSetBehavior(WFToken in_schema, WFStrPtr in_value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Add a string resource entry to a Schema
|
* @brief Add a string resource entry to a Schema
|
||||||
@@ -272,9 +250,9 @@ bool WFSchemaSetBehavior(WFToken in_schema, WFCString in_value);
|
|||||||
* @param[in] in_name Null-terminated UTF-8 string containing the name of this entry
|
* @param[in] in_name Null-terminated UTF-8 string containing the name of this entry
|
||||||
* @param[in] in_value Null-terminated UTF-8 string containing the value of this entry.
|
* @param[in] in_value Null-terminated UTF-8 string containing the value of this entry.
|
||||||
* It can be a plain string or a reference string to resource.
|
* It can be a plain string or a reference string to resource.
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFSchemaAddStr(WFToken in_schema, WFCString in_name, WFCString in_value);
|
WFError WFSchemaAddStr(WFToken in_schema, WFStrPtr in_name, WFStrPtr in_value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Add an icon registry entry to a Schema
|
* @brief Add an icon registry entry to a Schema
|
||||||
@@ -283,9 +261,9 @@ bool WFSchemaAddStr(WFToken in_schema, WFCString in_name, WFCString in_value);
|
|||||||
* @param[in] in_name Null-terminated UTF-8 string containing the name of this entry
|
* @param[in] in_name Null-terminated UTF-8 string containing the name of this entry
|
||||||
* @param[in] in_value Null-terminated UTF-8 string containing the value of this entry.
|
* @param[in] in_value Null-terminated UTF-8 string containing the value of this entry.
|
||||||
* It can be a path to icon or a reference string to resource.
|
* It can be a path to icon or a reference string to resource.
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFSchemaAddIcon(WFToken in_schema, WFCString in_name, WFCString in_value);
|
WFError WFSchemaAddIcon(WFToken in_schema, WFStrPtr in_name, WFStrPtr in_value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Add a behavior registry entry to a Schema
|
* @brief Add a behavior registry entry to a Schema
|
||||||
@@ -294,9 +272,9 @@ bool WFSchemaAddIcon(WFToken in_schema, WFCString in_name, WFCString in_value);
|
|||||||
* @param[in] in_name Null-terminated UTF-8 string containing the name of this entry
|
* @param[in] in_name Null-terminated UTF-8 string containing the name of this entry
|
||||||
* @param[in] in_value Null-terminated UTF-8 string containing the value of this entry.
|
* @param[in] in_value Null-terminated UTF-8 string containing the value of this entry.
|
||||||
* It should be a valid command line string which use \c %1, \c %2, etc. to represent parameters.
|
* It should be a valid command line string which use \c %1, \c %2, etc. to represent parameters.
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFSchemaAddBehavior(WFToken in_schema, WFCString in_name, WFCString in_value);
|
WFError WFSchemaAddBehavior(WFToken in_schema, WFStrPtr in_name, WFStrPtr in_value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Add a file extension to a Schema
|
* @brief Add a file extension to a Schema
|
||||||
@@ -309,13 +287,13 @@ bool WFSchemaAddBehavior(WFToken in_schema, WFCString in_name, WFCString in_valu
|
|||||||
* This name should be registered by calling WFSchemaAddIcon().
|
* This name should be registered by calling WFSchemaAddIcon().
|
||||||
* @param[in] in_ext_behavior Null-terminated UTF-8 string containing the name pointing to associated behavior for this extension.
|
* @param[in] in_ext_behavior Null-terminated UTF-8 string containing the name pointing to associated behavior for this extension.
|
||||||
* This name should be registered by calling WFSchemaAddBehavior().
|
* This name should be registered by calling WFSchemaAddBehavior().
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFSchemaAddExt(WFToken in_schema,
|
WFError WFSchemaAddExt(WFToken in_schema,
|
||||||
WFCString in_ext,
|
WFStrPtr in_ext,
|
||||||
WFCString in_ext_name,
|
WFStrPtr in_ext_name,
|
||||||
WFCString in_ext_icon,
|
WFStrPtr in_ext_icon,
|
||||||
WFCString in_ext_behavior);
|
WFStrPtr in_ext_behavior);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Create a Program object from a Schema
|
* @brief Create a Program object from a Schema
|
||||||
@@ -331,9 +309,9 @@ bool WFSchemaAddExt(WFToken in_schema,
|
|||||||
* @param[out] out_program Pointer to receive the Program token.
|
* @param[out] out_program Pointer to receive the Program token.
|
||||||
* The receiver take the ownership of this Program object.
|
* The receiver take the ownership of this Program object.
|
||||||
* And it should be freed by calling WFProgramDestroy() when it is no longer needed.
|
* And it should be freed by calling WFProgramDestroy() when it is no longer needed.
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFProgramCreate(WFToken in_schema, WFToken *out_program);
|
WFError WFProgramCreate(WFToken in_schema, WFToken *out_program);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Destroy a Program object
|
* @brief Destroy a Program object
|
||||||
@@ -341,9 +319,9 @@ bool WFProgramCreate(WFToken in_schema, WFToken *out_program);
|
|||||||
* Releases resources associated with the Program.
|
* Releases resources associated with the Program.
|
||||||
*
|
*
|
||||||
* @param[in] in_program Program token to destroy
|
* @param[in] in_program Program token to destroy
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFProgramDestroy(WFToken in_program);
|
WFError WFProgramDestroy(WFToken in_program);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Resolve the provided program name of this Program
|
* @brief Resolve the provided program name of this Program
|
||||||
@@ -356,9 +334,9 @@ bool WFProgramDestroy(WFToken in_program);
|
|||||||
* @param[out] out_name Pointer to receive the resolved name.
|
* @param[out] out_name Pointer to receive the resolved name.
|
||||||
* There is no possibility that this value is NULL.
|
* There is no possibility that this value is NULL.
|
||||||
* This string will be freed at the next API call. Please make a copy immediately if you need to use it longer.
|
* This string will be freed at the next API call. Please make a copy immediately if you need to use it longer.
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFProgramResolveName(WFToken in_program, WFCString *out_name);
|
WFError WFProgramResolveName(WFToken in_program, WFStrPtr *out_name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Resolve the Program icon resource
|
* @brief Resolve the Program icon resource
|
||||||
@@ -371,18 +349,18 @@ bool WFProgramResolveName(WFToken in_program, WFCString *out_name);
|
|||||||
* @param[out] out_icon_rc Pointer to receive the icon resource token.
|
* @param[out] out_icon_rc Pointer to receive the icon resource token.
|
||||||
* The caller take the ownership of created icon resource object.
|
* The caller take the ownership of created icon resource object.
|
||||||
* And it should be freed by calling WFIconRcDestroy() when it is no longer needed.
|
* And it should be freed by calling WFIconRcDestroy() when it is no longer needed.
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFProgramResolveIcon(WFToken in_program, WFToken *out_icon_rc);
|
WFError WFProgramResolveIcon(WFToken in_program, WFToken *out_icon_rc);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the number of file extensions in the Program
|
* @brief Get the number of file extensions in the Program
|
||||||
*
|
*
|
||||||
* @param[in] in_program Program token
|
* @param[in] in_program Program token
|
||||||
* @param[out] out_len Pointer to receive the number of extensions
|
* @param[out] out_len Pointer to receive the number of extensions
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFProgramExtsLen(WFToken in_program, size_t *out_len);
|
WFError WFProgramExtsLen(WFToken in_program, size_t *out_len);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Find a file extension by its body (extension string)
|
* @brief Find a file extension by its body (extension string)
|
||||||
@@ -390,9 +368,9 @@ bool WFProgramExtsLen(WFToken in_program, size_t *out_len);
|
|||||||
* @param[in] in_program Program token
|
* @param[in] in_program Program token
|
||||||
* @param[in] in_body Null-terminated UTF-8 string containing the file extension name (without leading dot) to find.
|
* @param[in] in_body Null-terminated UTF-8 string containing the file extension name (without leading dot) to find.
|
||||||
* @param[out] out_index Pointer to receive the file extension index, or WF_INVALID_INDEX if not found.
|
* @param[out] out_index Pointer to receive the file extension index, or WF_INVALID_INDEX if not found.
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFProgramFindExt(WFToken in_program, WFCString in_body, size_t *out_index);
|
WFError WFProgramFindExt(WFToken in_program, WFStrPtr in_body, size_t *out_index);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Resolve this program provided extension's details by index
|
* @brief Resolve this program provided extension's details by index
|
||||||
@@ -402,27 +380,27 @@ bool WFProgramFindExt(WFToken in_program, WFCString in_body, size_t *out_index);
|
|||||||
* @param[out] out_self_ext_status Pointer to receive the self extension status token.
|
* @param[out] out_self_ext_status Pointer to receive the self extension status token.
|
||||||
* The caller take the ownership of created self extension status object.
|
* The caller take the ownership of created self extension status object.
|
||||||
* And it should be freed by calling WFSelfExtStatusDestroy() when it is no longer needed.
|
* And it should be freed by calling WFSelfExtStatusDestroy() when it is no longer needed.
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFProgramResolveExt(WFToken in_program, size_t in_index, WFToken *out_self_ext_status);
|
WFError WFProgramResolveExt(WFToken in_program, size_t in_index, WFToken *out_self_ext_status);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Register the Program in the specified scope
|
* @brief Register the Program in the specified scope
|
||||||
*
|
*
|
||||||
* @param[in] in_program Program token
|
* @param[in] in_program Program token
|
||||||
* @param[in] in_scope Registration scope
|
* @param[in] in_scope Registration scope
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFProgramRegister(WFToken in_program, WFScope in_scope);
|
WFError WFProgramRegister(WFToken in_program, WFScope in_scope);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Unregister the Program from the specified scope
|
* @brief Unregister the Program from the specified scope
|
||||||
*
|
*
|
||||||
* @param[in] in_program Program token
|
* @param[in] in_program Program token
|
||||||
* @param[in] in_scope Registration scope
|
* @param[in] in_scope Registration scope
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFProgramUnregister(WFToken in_program, WFScope in_scope);
|
WFError WFProgramUnregister(WFToken in_program, WFScope in_scope);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Check if the Program is registered in the specified scope
|
* @brief Check if the Program is registered in the specified scope
|
||||||
@@ -431,9 +409,9 @@ bool WFProgramUnregister(WFToken in_program, WFScope in_scope);
|
|||||||
* @param[in] in_scope Registration scope for checking
|
* @param[in] in_scope Registration scope for checking
|
||||||
* @param[out] out_is_registered Pointer to receive the registration status.
|
* @param[out] out_is_registered Pointer to receive the registration status.
|
||||||
* True if the Program is registered in the specified scope, false otherwise.
|
* True if the Program is registered in the specified scope, false otherwise.
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFProgramIsRegistered(WFToken in_program, WFScope in_scope, bool *out_is_registered);
|
WFError WFProgramIsRegistered(WFToken in_program, WFScope in_scope, bool *out_is_registered);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Link a file extension in the specified scope
|
* @brief Link a file extension in the specified scope
|
||||||
@@ -441,9 +419,9 @@ bool WFProgramIsRegistered(WFToken in_program, WFScope in_scope, bool *out_is_re
|
|||||||
* @param[in] in_program Program token
|
* @param[in] in_program Program token
|
||||||
* @param[in] in_scope Registration scope
|
* @param[in] in_scope Registration scope
|
||||||
* @param[in] in_index Index of the extension to link
|
* @param[in] in_index Index of the extension to link
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFProgramLinkExt(WFToken in_program, WFScope in_scope, size_t in_index);
|
WFError WFProgramLinkExt(WFToken in_program, WFScope in_scope, size_t in_index);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Unlink a file extension in the specified scope
|
* @brief Unlink a file extension in the specified scope
|
||||||
@@ -451,9 +429,9 @@ bool WFProgramLinkExt(WFToken in_program, WFScope in_scope, size_t in_index);
|
|||||||
* @param[in] in_program Program token
|
* @param[in] in_program Program token
|
||||||
* @param[in] in_scope Registration scope
|
* @param[in] in_scope Registration scope
|
||||||
* @param[in] in_index Index of the extension to unlink
|
* @param[in] in_index Index of the extension to unlink
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFProgramUnlinkExt(WFToken in_program, WFScope in_scope, size_t in_index);
|
WFError WFProgramUnlinkExt(WFToken in_program, WFScope in_scope, size_t in_index);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Query the status of a file extension
|
* @brief Query the status of a file extension
|
||||||
@@ -461,21 +439,21 @@ bool WFProgramUnlinkExt(WFToken in_program, WFScope in_scope, size_t in_index);
|
|||||||
* @param[in] in_program Program token
|
* @param[in] in_program Program token
|
||||||
* @param[in] in_view View viewpoint.
|
* @param[in] in_view View viewpoint.
|
||||||
* @param[in] in_index Index of the extension to query
|
* @param[in] in_index Index of the extension to query
|
||||||
* @param[out] out_ext_status Pointer to receive the extension status token, or invalid token if not found.
|
* @param[out] out_ext_status Pointer to receive the extension status token, or WF_INVALID_TOKEN if not found.
|
||||||
* If the extension is not found, it usually means that this extension is not registered in the specified scope.
|
* If the extension is not found, it usually means that this extension is not registered in the specified scope.
|
||||||
* The caller take the ownership of created extension status object.
|
* The caller take the ownership of created extension status object.
|
||||||
* And it should be freed by calling WFExtStatusDestroy() when it is no longer needed.
|
* And it should be freed by calling WFExtStatusDestroy() when it is no longer needed.
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFProgramQueryExt(WFToken in_program, WFView in_view, size_t in_index, WFToken *out_ext_status);
|
WFError WFProgramQueryExt(WFToken in_program, WFView in_view, size_t in_index, WFToken *out_ext_status);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Destroy an extension status object
|
* @brief Destroy an extension status object
|
||||||
*
|
*
|
||||||
* @param[in] in_ext_status Extension status token to destroy
|
* @param[in] in_ext_status Extension status token to destroy
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFExtStatusDestroy(WFToken in_ext_status);
|
WFError WFExtStatusDestroy(WFToken in_ext_status);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the display name from an extension status object
|
* @brief Get the display name from an extension status object
|
||||||
@@ -488,9 +466,9 @@ bool WFExtStatusDestroy(WFToken in_ext_status);
|
|||||||
* There is no possibility that this value is NULL.
|
* There is no possibility that this value is NULL.
|
||||||
* We will try to use localized name first, then use raw ProgId name if localized name is not available.
|
* We will try to use localized name first, then use raw ProgId name if localized name is not available.
|
||||||
* This string will be freed at the next API call. Please make a copy immediately if you need to use it longer.
|
* This string will be freed at the next API call. Please make a copy immediately if you need to use it longer.
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFExtStatusGetName(WFToken in_ext_status, WFCString *out_name);
|
WFError WFExtStatusGetName(WFToken in_ext_status, WFStrPtr *out_name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the icon from an extension status object
|
* @brief Get the icon from an extension status object
|
||||||
@@ -502,17 +480,17 @@ bool WFExtStatusGetName(WFToken in_ext_status, WFCString *out_name);
|
|||||||
* @param[out] out_icon Pointer to receive the icon handle.
|
* @param[out] out_icon Pointer to receive the icon handle.
|
||||||
* This icon handle will be freed once this icon resource object is destroyed.
|
* This icon handle will be freed once this icon resource object is destroyed.
|
||||||
* Please make a copy immediately if you need to use it longer.
|
* Please make a copy immediately if you need to use it longer.
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFExtStatusGetIcon(WFToken in_ext_status, WFHICON *out_icon);
|
WFError WFExtStatusGetIcon(WFToken in_ext_status, WFHICON *out_icon);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Destroy a self extension status object
|
* @brief Destroy a self extension status object
|
||||||
*
|
*
|
||||||
* @param[in] in_self_ext_status Self extension status token to destroy
|
* @param[in] in_self_ext_status Self extension status token to destroy
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFSelfExtStatusDestroy(WFToken in_self_ext_status);
|
WFError WFSelfExtStatusDestroy(WFToken in_self_ext_status);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the display name from a self extension status object
|
* @brief Get the display name from a self extension status object
|
||||||
@@ -524,9 +502,9 @@ bool WFSelfExtStatusDestroy(WFToken in_self_ext_status);
|
|||||||
* @param[out] out_name Pointer to receive the name string.
|
* @param[out] out_name Pointer to receive the name string.
|
||||||
* There is no possibility that this value is NULL.
|
* There is no possibility that this value is NULL.
|
||||||
* This string will be freed at the next API call. Please make a copy immediately if you need to use it longer.
|
* This string will be freed at the next API call. Please make a copy immediately if you need to use it longer.
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFSelfExtStatusGetName(WFToken in_self_ext_status, WFCString *out_name);
|
WFError WFSelfExtStatusGetName(WFToken in_self_ext_status, WFStrPtr *out_name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the icon from a self extension status object
|
* @brief Get the icon from a self extension status object
|
||||||
@@ -538,9 +516,9 @@ bool WFSelfExtStatusGetName(WFToken in_self_ext_status, WFCString *out_name);
|
|||||||
* @param[out] out_icon Pointer to receive the icon handle.
|
* @param[out] out_icon Pointer to receive the icon handle.
|
||||||
* This icon handle will be freed once this self extension status object is destroyed.
|
* This icon handle will be freed once this self extension status object is destroyed.
|
||||||
* Please make a copy immediately if you need to use it longer.
|
* Please make a copy immediately if you need to use it longer.
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFSelfExtStatusGetIcon(WFToken in_self_ext_status, WFHICON *out_icon);
|
WFError WFSelfExtStatusGetIcon(WFToken in_self_ext_status, WFHICON *out_icon);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the extension string (without leading dot) from a self extension status object
|
* @brief Get the extension string (without leading dot) from a self extension status object
|
||||||
@@ -549,9 +527,9 @@ bool WFSelfExtStatusGetIcon(WFToken in_self_ext_status, WFHICON *out_icon);
|
|||||||
* @param[out] out_inner Pointer to receive the file extension name (without leading dot).
|
* @param[out] out_inner Pointer to receive the file extension name (without leading dot).
|
||||||
* There is no possibility that this value is NULL.
|
* There is no possibility that this value is NULL.
|
||||||
* This string will be freed at the next API call. Please make a copy immediately if you need to use it longer.
|
* This string will be freed at the next API call. Please make a copy immediately if you need to use it longer.
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFSelfExtStatusGetExt(WFToken in_self_ext_status, WFCString *out_inner);
|
WFError WFSelfExtStatusGetExt(WFToken in_self_ext_status, WFStrPtr *out_inner);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the dotted extension string (with leading dot) from a self extension status object
|
* @brief Get the dotted extension string (with leading dot) from a self extension status object
|
||||||
@@ -560,17 +538,17 @@ bool WFSelfExtStatusGetExt(WFToken in_self_ext_status, WFCString *out_inner);
|
|||||||
* @param[out] out_inner Pointer to receive the file extension string (with leading dot).
|
* @param[out] out_inner Pointer to receive the file extension string (with leading dot).
|
||||||
* There is no possibility that this value is NULL.
|
* There is no possibility that this value is NULL.
|
||||||
* This string will be freed at the next API call. Please make a copy immediately if you need to use it longer.
|
* This string will be freed at the next API call. Please make a copy immediately if you need to use it longer.
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFSelfExtStatusGetDottedExt(WFToken in_self_ext_status, WFCString *out_inner);
|
WFError WFSelfExtStatusGetDottedExt(WFToken in_self_ext_status, WFStrPtr *out_inner);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Destroy an icon resource object
|
* @brief Destroy an icon resource object
|
||||||
*
|
*
|
||||||
* @param[in] in_icon_rc Icon resource token to destroy
|
* @param[in] in_icon_rc Icon resource token to destroy
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFIconRcDestroy(WFToken in_icon_rc);
|
WFError WFIconRcDestroy(WFToken in_icon_rc);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the icon handle from an icon resource object
|
* @brief Get the icon handle from an icon resource object
|
||||||
@@ -580,9 +558,9 @@ bool WFIconRcDestroy(WFToken in_icon_rc);
|
|||||||
* There is no possibility that this value is WF_INVALID_HICON.
|
* There is no possibility that this value is WF_INVALID_HICON.
|
||||||
* This icon handle will be freed once this icon resource object is destroyed.
|
* This icon handle will be freed once this icon resource object is destroyed.
|
||||||
* Please make a copy immediately if you need to use it longer.
|
* Please make a copy immediately if you need to use it longer.
|
||||||
* @return true on success, false on failure
|
* @return WFERROR_OK on success, WFERROR_ERR on failure
|
||||||
*/
|
*/
|
||||||
bool WFIconRcGetIcon(WFToken in_icon_rc, WFHICON *out_icon);
|
WFError WFIconRcGetIcon(WFToken in_icon_rc, WFHICON *out_icon);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
|
|||||||
Reference in New Issue
Block a user