summaryrefslogtreecommitdiffstats
path: root/src/account_portal.h
diff options
context:
space:
mode:
authorMavridis Philippe <[email protected]>2024-07-08 18:58:28 +0300
committerMavridis Philippe <[email protected]>2024-07-08 18:59:14 +0300
commita5eb53fcbc12342f0a12ef4819146b2d0bb14652 (patch)
tree0d7bd718644ded44e69b6a6102173d699131c0b2 /src/account_portal.h
parent87769ed51d8087ddc4a02705f39fe4f21431b66f (diff)
downloadxdg-desktop-portal-tde-a5eb53fcbc12342f0a12ef4819146b2d0bb14652.tar.gz
xdg-desktop-portal-tde-a5eb53fcbc12342f0a12ef4819146b2d0bb14652.zip
Added Account portal, permission dialog class, moved some code to util
Signed-off-by: Mavridis Philippe <[email protected]>
Diffstat (limited to 'src/account_portal.h')
-rw-r--r--src/account_portal.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/account_portal.h b/src/account_portal.h
new file mode 100644
index 0000000..b75fe26
--- /dev/null
+++ b/src/account_portal.h
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ XDG desktop portal implementation for TDE
+ Copyright © 2024 Mavridis Philippe <[email protected]>
+
+ This program or library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the License,
+ or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Improvements and feedback are welcome!
+*******************************************************************************/
+
+#ifndef __ACCOUNT_PORTAL_H
+#define __ACCOUNT_PORTAL_H
+
+// Portal
+#include "interfaces/accountInterface.h"
+#include "interface.h"
+
+struct AccountInfo
+{
+ TQString userId;
+ TQString loginName;
+ TQString realName;
+ TQString homeDirectory;
+ TQString avatarPath;
+};
+
+class TDEPermissionDialog;
+
+class TDEAccountPortal : public TQObject,
+ public org::freedesktop::impl::portal::AccountInterface
+{
+ public:
+ INTERFACE("org.freedesktop.impl.portal.Account")
+
+ TDEAccountPortal(TQT_DBusConnection &connection);
+ virtual ~TDEAccountPortal();
+
+ protected:
+ virtual void handleMethodReply(const TQT_DBusMessage& reply);
+ virtual bool handleSignalSend(const TQT_DBusMessage& reply);
+
+ virtual bool GetUserInformation(const TQT_DBusObjectPath& handle,
+ const TQString& app_id,
+ const TQString& window,
+ const TQT_DBusVariantMap& options,
+ TQ_UINT32& response,
+ TQT_DBusVariantMap& results,
+ TQT_DBusError& error);
+
+ AccountInfo getAccountInfo();
+ void appendDataPreview(TDEPermissionDialog *dlg, AccountInfo info);
+
+ private:
+ void findUserAvatar(AccountInfo &info);
+
+ private:
+ TQT_DBusConnection m_connection;
+};
+
+#endif // __ACCOUNT_PORTAL_H
+
+// kate: replace-tabs true; tab-width 4; indent-width 4; \ No newline at end of file