summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-02-23 19:57:58 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-02-23 19:57:58 +0300
commitdc597d70cef7202480eae6708e2142148e09356f (patch)
tree459e171a2e8a5bb2def7d7aea67fb769aa224bb2 /include
parent349ff91be06644a8b611ecf6a39ce0ac1bcde86a (diff)
clipboard copy function is able now to copy in multiple formats at a time
Diffstat (limited to 'include')
-rw-r--r--include/m_utils.h48
1 files changed, 43 insertions, 5 deletions
diff --git a/include/m_utils.h b/include/m_utils.h
index 776e087b37..7949e5dc60 100644
--- a/include/m_utils.h
+++ b/include/m_utils.h
@@ -53,12 +53,50 @@ EXTERN_C MIR_CORE_DLL(void) Utils_OpenUrlW(const wchar_t *pszUrl, bool bOpenInNe
/////////////////////////////////////////////////////////////////////////////////////////
// copies a string into clipboard
-MIR_CORE_DLL(void) Utils_ClipboardCopy(const char *pszText);
-MIR_CORE_DLL(void) Utils_ClipboardCopy(const wchar_t *pszText);
+struct MIR_CORE_EXPORT MClipData : public MNonCopyable
+{
+ const MClipData *m_pNext = 0;
-__forceinline void Utils_ClipboardCopyU(const char *p)
-{ Utils_ClipboardCopy(Utf2T(p));
-}
+ MClipData& operator+(const MClipData &);
+
+ virtual void Copy() const = 0;
+};
+
+struct MIR_CORE_EXPORT MClipAnsi : public MClipData
+{
+ const char *m_szString;
+
+ explicit MClipAnsi(const char *pszString);
+
+ void Copy() const override;
+};
+
+struct MIR_CORE_EXPORT MClipUnicode : public MClipData
+{
+ const wchar_t *m_wszString;
+
+ explicit MClipUnicode(const wchar_t *pwszString);
+
+ void Copy() const override;
+};
+
+struct MClipUtf8 : public MClipUnicode
+{
+ explicit MClipUtf8(const char *pszString) :
+ MClipUnicode(Utf2T(pszString))
+ {}
+};
+
+struct MIR_CORE_EXPORT MClipRtf : public MClipData
+{
+ const char *m_szString;
+
+ explicit MClipRtf(const char *pszString);
+
+ void Copy() const override;
+};
+
+MIR_CORE_DLL(void) Utils_ClipboardCopy(const MClipData &pData);
/////////////////////////////////////////////////////////////////////////////////////////
// Resizes a dialog by calling a custom routine to move the individual