Documentation ¶
Index ¶
- Constants
- Variables
- func GetDesktopDir() string
- func GetUserSpecialDir(dir glib.UserDirectory) string
- type AppGroup
- type Application
- func (app *Application) ActivateFile(file string, args []string, isExecutable bool, flag int32) error
- func (app *Application) ActivateFileWithTimestamp(file string, args []string, isExecutable bool, timestamp uint32, flag int32) error
- func (app *Application) DestroyMenu()
- func (app *Application) GenMenuContent(uris []string) string
- func (app *Application) GenMenuContentWithExtraItems(uris []string, withExtraItems bool) string
- func (app *Application) GetAppGroupItems(appGroup string) (map[string]ItemInfo, error)
- func (app *Application) GetDBusInfo() dbus.DBusInfo
- func (app *Application) GetDesktopItems() (map[string]ItemInfo, error)
- func (app *Application) GetItemInfo(file string) (ItemInfo, error)
- func (app *Application) HandleSelectedMenuItem(id string)
- func (app *Application) HandleSelectedMenuItemWithTimestamp(id string, timestamp uint32)
- func (app *Application) IsAppGroup(uri string) bool
- func (app *Application) RequestCreatingAppGroup(files []string) error
- func (app *Application) RequestMergeIntoAppGroup(files []string, appGroup string) error
- type CategoryInfo
- type CategoryInfos
- type ComputerItem
- type Desktop
- type IMenuable
- type Item
- type ItemInfo
- type Menu
- type MenuItem
- type Settings
- func (s *Settings) ActivationPolicy() string
- func (s *Settings) AllowDeleteImmediatlyIsEnable() bool
- func (s *Settings) AutoArrangement() bool
- func (s *Settings) ClickPolicy() string
- func (s *Settings) ConfirmEmptyTrashIsEnable() bool
- func (s *Settings) ConfirmTrashIsEnable() bool
- func (s *Settings) DisplayExtraItems() bool
- func (s *Settings) EnableAutoArrangement(enable bool)
- func (s *Settings) EnableShowComputerIcon(enable bool)
- func (s *Settings) EnableShowTrashIcon(enable bool)
- func (s *Settings) EnableStickupGrid(enable bool)
- func (s *Settings) GetDBusInfo() dbus.DBusInfo
- func (s *Settings) IconDefaultSize() int32
- func (s *Settings) IconZoomLevel() int32
- func (s *Settings) LabelPosition() string
- func (s *Settings) SetIconZoomLevel(zoomLevel int32) bool
- func (s *Settings) ShowComputerIconIsEnable() bool
- func (s *Settings) ShowExtensionNameIsEnable() bool
- func (s *Settings) ShowHiddenFilesIsEnable() bool
- func (s *Settings) ShowThumbnail() string
- func (s *Settings) ShowTrashIconIsEnable() bool
- func (s *Settings) ShowTrashedItemCountIsEnable() bool
- func (s *Settings) StickupGridIsEnable() bool
- func (s *Settings) ThumbnailSizeLimitation() uint64
- type TrashItem
Constants ¶
const ( // OpOpen indicates opening files OpOpen int32 = iota // OpSelect indicates selecting open programming. OpSelect )
used by RequestOpen signal
const ( // ActivateFlagNone do nothing. ActivateFlagNone int32 = iota // ActivateFlagRun run file directly. ActivateFlagRun // ActivateFlagRunInTerminal run files in terminal. ActivateFlagRunInTerminal // ActivateFlagDisplay display files. ActivateFlagDisplay )
const ( // FileManagerPerferenceSchemaID is filemanager's general preferences' schema id FileManagerPerferenceSchemaID string = "com.deepin.filemanager.preferences" // FileManagerDesktopSchemaID is desktop specific settings' schema id FileManagerDesktopSchemaID string = "com.deepin.dde.desktop" )
const ( // ConfirmTrash schema key. ConfirmTrash = "confirm-trash" // ConfirmEmptyTrash schema key. ConfirmEmptyTrash = "confirm-empty-trash" // ActivationPolicy schema key. ActivationPolicy = "activation-policy" // ClickPolicy schema key. ClickPolicy = "click-policy" // ShowThumbnail schema key. ShowThumbnail = "show-thumbnail" // ShowHiddenFiles schema key. ShowHiddenFiles = "show-hidden-files" // ShowExtensionName schema key. ShowExtensionName = "show-extension-name" // LabelPosition schema key. LabelPosition = "label-position" // AllowDeleteImmediatly schema key. AllowDeleteImmediatly = "allow-delete-immediatly" // ShowComputerIcon schema key. ShowComputerIcon string = "show-computer-icon" // ShowTrashIcon schema key. ShowTrashIcon = "show-trash-icon" // StickupGrid schema key. StickupGrid = "stickup-grid" // AutoArrangement schema key. AutoArrangement = "auto-arrangement" // ShowTrashedItemCount schema key. ShowTrashedItemCount = "show-trashed-item-number" // SortOrder schema key. SortOrder = "sort-order" // IconDefaultSize schema key IconDefaultSize = "icon-default-size" // IconZoomLevel schema key IconZoomLevel = "icon-zoom-level" // ThumbnailSizeLimitation schema key ThumbnailSizeLimitation = "thumbnail-size-limitation" // ThumbnailSizeUnit schema key ThumbnailSizeUnit = "thumbnail-size-unit" DisplayExtraItems = "display-extra-items" )
const ( // ActivationPolicyAsk indicates ask for behaviours when activation. ActivationPolicyAsk string = "ask" // ActivationPolicyLaunch indicates launch files when activation. ActivationPolicyLaunch string = "launch" // ActivationPolicyDisplay indicates display files when activation. ActivationPolicyDisplay string = "display" )
const ( SizeUnitByte int = iota SizeUnitKiB SizeUnitMB SizeUnitGB SizeUnitTB SizeUnitPB )
const ( // AppGroupPrefix is the prefix of AppGroup's name. AppGroupPrefix string = ".deepin_rich_dir_" )
Variables ¶
var ArchiveMimeTypes = []string{
"application/x-gtar",
"application/x-zip",
"application/x-zip-compressed",
"application/zip",
"application/x-zip",
"application/x-tar",
"application/x-7z-compressed",
"application/x-rar",
"application/x-rar-compressed",
"application/x-jar",
"application/x-java-archive",
"application/x-war",
"application/x-ear",
"application/x-arj",
"application/x-gzip",
"application/gzip",
"application/x-bzip-compressed-tar",
"application/x-compressed-tar",
"application/x-archive",
"application/x-xz-compressed-tar",
"application/x-bzip",
"application/x-cbz",
"application/x-xz",
"application/x-lzma-compressed-tar",
"application/x-ms-dos-executable",
"application/x-lzma",
"application/x-cd-image",
"application/x-deb",
"application/x-rpm",
"application/x-stuffit",
"application/x-tzo",
"application/x-tarz",
"application/x-tzo",
"application/x-msdownload",
"application/x-lha",
"application/x-zoo",
}
ArchiveMimeTypes is a list of MIMEType for archive files.
Functions ¶
func GetUserSpecialDir ¶
func GetUserSpecialDir(dir glib.UserDirectory) string
GetUserSpecialDir returns user special dir, like music directory.
Types ¶
type AppGroup ¶
type AppGroup struct {
*Item
}
AppGroup represents appgroup on desktop.
func NewAppGroup ¶
func NewAppGroup(app *Application, uris []string) *AppGroup
NewAppGroup creates a app group.
type Application ¶
type Application struct { ActivateFlagDisplay int32 ActivateFlagRunInTerminal int32 ActivateFlagRun int32 RequestOpenPolicyOpen int32 RequestOpenPolicySelect int32 RequestRename func(string) RequestDelete func([]string) RequestEmptyTrash func() RequestSort func(string) RequestCleanup func() ReqeustAutoArrange func() RequestCreateFile func() RequestCreateFileFromTemplate func(string) RequestCreateDirectory func() ItemCut func([]string) ItemCopied func([]string) RequestOpen func([]string, []int32) AppGroupCreated func(string, []string) AppGroupDeleted func(string) AppGroupMerged func(string, []string) ItemDeleted func(string) ItemCreated func(string) ItemModified func(string) // contains filtered or unexported fields }
Application for desktop daemon.
func NewApplication ¶
func NewApplication(s *Settings) *Application
NewApplication creates a application, settings must not be nil.
func NewDesktopDaemon ¶
func NewDesktopDaemon() (*Application, error)
func (*Application) ActivateFile ¶
func (app *Application) ActivateFile(file string, args []string, isExecutable bool, flag int32) error
ActivateFile will activate file. NB: **deprecated**, compatible interface, use ActivateFileWithTimestamp instead.
func (*Application) ActivateFileWithTimestamp ¶
func (app *Application) ActivateFileWithTimestamp(file string, args []string, isExecutable bool, timestamp uint32, flag int32) error
ActivateFileWithTimestamp will activate file.
func (*Application) DestroyMenu ¶
func (app *Application) DestroyMenu()
DestroyMenu destroys the useless menu.
func (*Application) GenMenuContent ¶
func (app *Application) GenMenuContent(uris []string) string
GenMenuContent returns the menu content in json format used in DeepinMenu.
func (*Application) GenMenuContentWithExtraItems ¶
func (app *Application) GenMenuContentWithExtraItems(uris []string, withExtraItems bool) string
func (*Application) GetAppGroupItems ¶
func (app *Application) GetAppGroupItems(appGroup string) (map[string]ItemInfo, error)
func (*Application) GetDBusInfo ¶
func (app *Application) GetDBusInfo() dbus.DBusInfo
GetDBusInfo returns dbus info of Application.
func (*Application) GetDesktopItems ¶
func (app *Application) GetDesktopItems() (map[string]ItemInfo, error)
GetDesktopItems returns all desktop files.
func (*Application) GetItemInfo ¶
func (app *Application) GetItemInfo(file string) (ItemInfo, error)
GetItemInfo gets ItemInfo for file.
func (*Application) HandleSelectedMenuItem ¶
func (app *Application) HandleSelectedMenuItem(id string)
HandleSelectedMenuItem will handle selected menu item according to passed id.
func (*Application) HandleSelectedMenuItemWithTimestamp ¶
func (app *Application) HandleSelectedMenuItemWithTimestamp(id string, timestamp uint32)
HandleSelectedMenuItemWithTimestamp will handle selected menu item according to passed id and timestamp.
func (*Application) IsAppGroup ¶
func (app *Application) IsAppGroup(uri string) bool
IsAppGroup returns whether uri is a AppGroup
func (*Application) RequestCreatingAppGroup ¶
func (app *Application) RequestCreatingAppGroup(files []string) error
RequestCreatingAppGroup creates app group according to the files, and emits AppGroupCreated signal when it's done.
func (*Application) RequestMergeIntoAppGroup ¶
func (app *Application) RequestMergeIntoAppGroup(files []string, appGroup string) error
RequestMergeIntoAppGroup will merge files into existed AppGroup, and emits AppGroupMerged signal when it's done.
type CategoryInfo ¶
CategoryInfo includes simple information for software category.
type CategoryInfos ¶
type CategoryInfos []CategoryInfo
CategoryInfos is an array of CategoryInfo, used by sort.Sort.
func (CategoryInfos) Len ¶
func (info CategoryInfos) Len() int
func (CategoryInfos) Less ¶
func (info CategoryInfos) Less(i, j int) bool
func (CategoryInfos) Swap ¶
func (info CategoryInfos) Swap(i, j int)
type ComputerItem ¶
type ComputerItem struct {
*Item
}
ComputerItem is computer item on desktop.
func NewComputerItem ¶
func NewComputerItem(app *Application, uri string) *ComputerItem
NewComputerItem creates new computer item.
func (*ComputerItem) GenMenu ¶
func (item *ComputerItem) GenMenu() (*Menu, error)
GenMenu generates json format menu content used in DeepinMenu for ComputerItem.
type Desktop ¶
type Desktop struct {
// contains filtered or unexported fields
}
Desktop is desktop itself.
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
Item is Normal Item, like file/directory/link.
type ItemInfo ¶
type ItemInfo struct { DisplayName string BaseName string URI string MIME string Icon string IconName string Thumbnail string Size int64 FileType uint16 IsBackup bool IsHidden bool IsReadOnly bool IsSymlink bool CanDelete bool CanExecute bool CanRead bool CanRename bool CanTrash bool CanWrite bool }
ItemInfo includes some simple informations.
type Menu ¶
type Menu struct {
// contains filtered or unexported fields
}
Menu is menu.
func (*Menu) AddSeparator ¶
AddSeparator adds a separator to menu.
func (*Menu) AppendItem ¶
AppendItem appends a new menu item to menu.
func (*Menu) HandleAction ¶
HandleAction will call the action corresponding to the id.
func (*Menu) SetIDGenerator ¶
SetIDGenerator changes the default id generator to the passed id generator.
type MenuItem ¶
type MenuItem struct { Action func(uint32) // contains filtered or unexported fields }
MenuItem is menu item.
type Settings ¶
type Settings struct { // signals IconZoomLevelChanged func(int32) ShowTrashIconChanged func(bool) ShowComputerIconChanged func(bool) StickupGridChanged func(bool) AutoArrangementChanged func(bool) ConfirmEmptyTrashChanged func(bool) ActivationPolicyChanged func(string) ClickPolicyChanged func(string) ShowThumbnailChanged func(string) ShowHiddenFilesChanged func(bool) ShowExtensionNameChanged func(bool) LabelPositionChanged func(string) AllowDeleteImmediatlyChanged func(bool) ThumbnailSizeLimitationChanged func(uint64) // contains filtered or unexported fields }
Settings is settings used by desktop.
func (*Settings) ActivationPolicy ¶
ActivationPolicy returns activation policy.
func (*Settings) AllowDeleteImmediatlyIsEnable ¶
AllowDeleteImmediatlyIsEnable returns whether AllowDeleteImmediatly is enabled.
func (*Settings) AutoArrangement ¶
func (*Settings) ClickPolicy ¶
ClickPolicy returns click policy.
func (*Settings) ConfirmEmptyTrashIsEnable ¶
ConfirmEmptyTrashIsEnable returns whether ConfirmEmptyTrash is enabled.
func (*Settings) ConfirmTrashIsEnable ¶
ConfirmTrashIsEnable returns whether ConfirmTrash is enabled.
func (*Settings) DisplayExtraItems ¶
func (*Settings) EnableAutoArrangement ¶
func (*Settings) EnableShowComputerIcon ¶
EnableShowComputerIcon enables or disables ShowComputerIcon.
func (*Settings) EnableShowTrashIcon ¶
EnableShowTrashIcon enables or disables ShowTrashIcon.
func (*Settings) EnableStickupGrid ¶
EnableStickupGrid enables or disables StickupGrid.
func (*Settings) GetDBusInfo ¶
GetDBusInfo returns dbus info for Settings.
func (*Settings) IconDefaultSize ¶
IconDefaultSize returns the default icon size.
func (*Settings) IconZoomLevel ¶
IconZoomLevel returns the zoom level of icons.
func (*Settings) LabelPosition ¶
LabelPosition returns the label position of name.
func (*Settings) SetIconZoomLevel ¶
SetIconZoomLevel will change the zoom level of icons.
func (*Settings) ShowComputerIconIsEnable ¶
ShowComputerIconIsEnable returns whether ShowComputerIcon is enabled.
func (*Settings) ShowExtensionNameIsEnable ¶
ShowExtensionNameIsEnable returns whether ShowExtensionName is enabled.
func (*Settings) ShowHiddenFilesIsEnable ¶
ShowHiddenFilesIsEnable returns whether ShowHiddenFiles is enabled.
func (*Settings) ShowThumbnail ¶
ShowThumbnail returns show thumbnail policy.
func (*Settings) ShowTrashIconIsEnable ¶
ShowTrashIconIsEnable returns whether ShowTrashIcon is enabled.
func (*Settings) ShowTrashedItemCountIsEnable ¶
ShowTrashedItemCountIsEnable returns whether ShowTrashedItemCount is enabled.
func (*Settings) StickupGridIsEnable ¶
StickupGridIsEnable returns whether StickupGrid is enabled.
func (*Settings) ThumbnailSizeLimitation ¶
type TrashItem ¶
type TrashItem struct {
*Item
}
TrashItem is TrashItem.
func NewTrashItem ¶
func NewTrashItem(app *Application, uri string) *TrashItem
NewTrashItem creates new trash item.