Documentation
¶
Index ¶
- Constants
- Variables
- func CheckPathStatus(path string) int
- type ErrorListModel
- type FolderInfo
- type FolderStructure
- type FrontendQt
- func (f *FrontendQt) IsAppRestarting() bool
- func (f *FrontendQt) LoadStructureForExport(addressOrID string)
- func (f *FrontendQt) Loop(setupError error) (err error)
- func (f *FrontendQt) QtExecute(Procedure func(*FrontendQt) error) error
- func (s *FrontendQt) SendNotification(tabIndex int, msg string)
- func (f *FrontendQt) StartExport(rootPath, login, fileType string, attachEncryptedBody bool)
- func (f *FrontendQt) StartImport(email string, importEncrypted bool)
- func (f *FrontendQt) StartUpdate()
- type GoQMLInterface
- type MboxList
- type PathStatus
- type TransferRules
Constants ¶
const ( FolderTypeSystem = "" FolderTypeLabel = "label" FolderTypeFolder = "folder" FolderTypeExternal = "external" )
Folder Type
const ( StatusNoInternet = "noInternet" StatusCheckingInternet = "internetCheck" StatusNewVersionAvailable = "oldVersion" StatusUpToDate = "upToDate" StatusForceUpdate = "forceupdate" )
Status
const ( // Account info Account = int(core.Qt__UserRole) + 1 + iota // 256 + 1 = 257 Status // 258 Password // 259 Aliases // ... IsExpanded // Folder info FolderId FolderName FolderColor FolderType FolderEntries IsFolderSelected FolderFromDate FolderToDate TargetFolderID TargetLabelIDs // Error list MailSubject MailDate MailFrom InputFolder ErrorMessage // Transfer rules mbox MboxSelectedIndex MboxIsActive MboxID MboxName MboxType MboxColor // Transfer Rules RuleTargetLabelColors RuleFromDate RuleToDate )
Constants for data map
const ( TypeEML = "EML" TypeMBOX = "MBOX" )
const ( TabGlobal = 0 TabSettings = 1 TabHelp = 2 TabQuit = 4 TabAddAccount = -1 )
const (
GlobalOptionIndex = -1
)
Variables ¶
var AllFolderInfoRoles = []int{ FolderId, FolderName, FolderColor, FolderType, FolderEntries, IsFolderSelected, FolderFromDate, FolderToDate, TargetFolderID, TargetLabelIDs, }
Functions ¶
func CheckPathStatus ¶
CheckPathStatus return PathStatus flag as int
Types ¶
type ErrorListModel ¶
type ErrorListModel struct { core.QAbstractListModel Progress *transfer.Progress // contains filtered or unexported fields }
ErrorListModel to sending error details to Qt
type FolderInfo ¶
type FolderInfo struct { FolderType string FolderEntries int // todo remove IsFolderSelected bool FromDate int64 // Unix seconds ToDate int64 // Unix seconds TargetFolderID string // target ID TODO: this will be hash TargetLabelIDs string // semicolon separated list of label ID same here // contains filtered or unexported fields }
FolderInfo is the element of model
It contains all data for one structure entry
func (*FolderInfo) AddTargetLabel ¶
func (s *FolderInfo) AddTargetLabel(targetID string)
func (*FolderInfo) IsType ¶
func (s *FolderInfo) IsType(askType string) bool
func (*FolderInfo) RemoveTargetLabel ¶
func (s *FolderInfo) RemoveTargetLabel(targetID string)
func (*FolderInfo) TargetLabelIDList ¶
func (s *FolderInfo) TargetLabelIDList() []string
type FolderStructure ¶
type FolderStructure struct { core.QAbstractListModel GlobalOptions FolderInfo // contains filtered or unexported fields }
FolderStructure model providing container for items (folder info) to QML
QML ListView connects the model from Go and it shows item (entities) information.
Copied and edited from `github.com/therecipe/qt/internal/examples/sailfish/listview`
NOTE: When implementing a model it is important to remember that QAbstractItemModel does not store any data itself !!!! see https://doc.qt.io/qt-5/model-view-programming.html#designing-a-model
func (*FolderStructure) GetInfo ¶
func (s *FolderStructure) GetInfo(row int) FolderInfo
type FrontendQt ¶
type FrontendQt struct { App *widgets.QApplication // Main Application pointer View *qml.QQmlApplicationEngine // QML engine pointer MainWin *core.QObject // Pointer to main window inside QML Qml *GoQMLInterface // Object accessible from both Go and QML for methods and signals Accounts qtcommon.Accounts // Providing data for accounts ListView TransferRules *TransferRules ErrorList *ErrorListModel // Providing data for error reporting // contains filtered or unexported fields }
FrontendQt is API between Import-Export and Qt
With this interface it is possible to control Qt-Gui interface using pointers to Qt and QML objects. QML signals and slots are connected via methods of GoQMLInterface.
func New ¶
func New( version, buildVersion string, panicHandler types.PanicHandler, config *config.Config, eventListener listener.Listener, updates types.Updater, ie types.ImportExporter, ) *FrontendQt
New is constructor for Import-Export Qt-Go interface
func (*FrontendQt) IsAppRestarting ¶
func (f *FrontendQt) IsAppRestarting() bool
IsAppRestarting for Import-Export is always false i.e never restarts
func (*FrontendQt) LoadStructureForExport ¶
func (f *FrontendQt) LoadStructureForExport(addressOrID string)
func (*FrontendQt) Loop ¶
func (f *FrontendQt) Loop(setupError error) (err error)
Loop function for Import-Export interface. It runs QtExecute in main thread with no additional function.
func (*FrontendQt) QtExecute ¶
func (f *FrontendQt) QtExecute(Procedure func(*FrontendQt) error) error
QtExecute in main for starting Qt application
It is needed to have just one Qt application per program (at least per same thread). This functions reads the main user interface defined in QML files. The files are appended to library by Qt-QRC.
func (*FrontendQt) SendNotification ¶
func (s *FrontendQt) SendNotification(tabIndex int, msg string)
func (*FrontendQt) StartExport ¶
func (f *FrontendQt) StartExport(rootPath, login, fileType string, attachEncryptedBody bool)
func (*FrontendQt) StartImport ¶
func (f *FrontendQt) StartImport(email string, importEncrypted bool)
func (*FrontendQt) StartUpdate ¶
func (f *FrontendQt) StartUpdate()
StartUpdate is identical to bridge
type GoQMLInterface ¶
GoQMLInterface between go and qml
Here we implements all the signals / methods.
func (*GoQMLInterface) SetFrontend ¶
func (s *GoQMLInterface) SetFrontend(f *FrontendQt)
SetFrontend connects all slots and signals from Go to QML
type MboxList ¶
type MboxList struct { core.QAbstractListModel // contains filtered or unexported fields }
MboxList is an interface between QML and targets for given rule.
type PathStatus ¶
type PathStatus int
PathStatus maps folder properties to flag
const ( PathOK PathStatus = 1 << iota PathEmptyPath PathWrongPath PathNotADir PathWrongPermissions PathDirEmpty )
Definition of PathStatus flags
type TransferRules ¶
type TransferRules struct { core.QAbstractListModel // contains filtered or unexported fields }
TransferRules is an interface between QML and transfer.