mirror of
https://gitflic.ru/project/astankevich/mtpview.git
synced 2024-11-23 15:08:23 +01:00
50 lines
1.2 KiB
C++
50 lines
1.2 KiB
C++
#ifndef MAINWINDOW_H
|
|
#define MAINWINDOW_H
|
|
|
|
#include <Window.h>
|
|
#include <OutlineListView.h>
|
|
#include <FilePanel.h>
|
|
#include <Messenger.h>
|
|
#include <Notification.h>
|
|
#include <libmtp.h>
|
|
|
|
|
|
class FileItem: public BStringItem
|
|
{
|
|
public:
|
|
FileItem(LIBMTP_mtpdevice_t * device, LIBMTP_devicestorage_t * storage, int id, BString filename, bool isFile, int depth);
|
|
inline int fileId(){return fId;}
|
|
inline bool isFile(){return fIsFile;}
|
|
inline bool isFolder(){return !fIsFile;}
|
|
inline LIBMTP_mtpdevice_t * device(){return this->fDevice;}
|
|
inline LIBMTP_devicestorage_t * storage() {return this->fStorage;}
|
|
void SetExpanded(bool expanded);
|
|
private:
|
|
int fId;
|
|
bool fIsFile;
|
|
LIBMTP_mtpdevice_t * fDevice;
|
|
LIBMTP_devicestorage_t *fStorage;
|
|
};
|
|
|
|
class MainWindow : public BWindow
|
|
{
|
|
public:
|
|
MainWindow(void);
|
|
void MessageReceived(BMessage *msg);
|
|
inline BOutlineListView * listView(){return this->fListView;};
|
|
void showErrorAlert(const char * message);
|
|
BNotification * uploadDownloadNotification;
|
|
private:
|
|
BOutlineListView *fListView;
|
|
BButton *download;
|
|
BButton *upload;
|
|
BFilePanel* openPanel;
|
|
BFilePanel* savePanel;
|
|
|
|
BMessenger * messenger;
|
|
|
|
FileItem * selectedItem;
|
|
};
|
|
|
|
#endif
|