Back to index

unity  6.0.0
Public Member Functions | Static Public Attributes
unity.emulators.launcher.LauncherModel Class Reference
Inheritance diagram for unity.emulators.launcher.LauncherModel:
Inheritance graph
[legend]
Collaboration diagram for unity.emulators.launcher.LauncherModel:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def get_bfb_icon
def get_launcher_icons
def get_bamf_launcher_icons
def get_launcher_icons_for_monitor
def get_icon_by_tooltip_text
def get_icon_by_desktop_id
def get_icon_by_window_xid
def get_icons_by_filter
def num_launcher_icons
def num_bamf_launcher_icons

Static Public Attributes

string DBUS_SERVICE = "com.canonical.Unity"
string DBUS_OBJECT = "/com/canonical/Unity/Debug"

Detailed Description

THe launcher model. Contains all launcher icons as children.

Definition at line 430 of file launcher.py.


Member Function Documentation

def unity.emulators.launcher.LauncherModel.get_bamf_launcher_icons (   self,
  visible_only = True 
)
Get a list of bamf launcher icons in this launcher.

Definition at line 445 of file launcher.py.

00445 
00446     def get_bamf_launcher_icons(self, visible_only=True):
00447         """Get a list of bamf launcher icons in this launcher."""
00448         if visible_only:
00449             return self.get_children_by_type(BamfLauncherIcon, visible=True)
00450         else:
00451             return self.get_children_by_type(BamfLauncherIcon)

Here is the caller graph for this function:

Definition at line 433 of file launcher.py.

00433 
00434     def get_bfb_icon(self):
00435         icons = BFBLauncherIcon.get_all_instances()
00436         assert(len(icons) == 1)
00437         return icons[0]

Gets a launcher icon with the specified desktop id.

Returns None if there is no such launcher icon.

Definition at line 471 of file launcher.py.

00471 
00472     def get_icon_by_desktop_id(self, desktop_id):
00473         """Gets a launcher icon with the specified desktop id.
00474 
00475         Returns None if there is no such launcher icon.
00476         """
00477         icons = self.get_children_by_type(SimpleLauncherIcon, desktop_id=desktop_id)
00478         if len(icons):
00479             return icons[0]
00480 
00481         return None

Get a launcher icon given it's tooltip text.

Returns None if there is no icon with the specified text.

Definition at line 461 of file launcher.py.

00461 
00462     def get_icon_by_tooltip_text(self, tooltip_text):
00463         """Get a launcher icon given it's tooltip text.
00464 
00465         Returns None if there is no icon with the specified text.
00466         """
00467         for icon in self.get_launcher_icons():
00468             if icon.tooltip_text == tooltip_text:
00469                 return icon
00470         return None

Here is the call graph for this function:

Gets a launcher icon that controls the specified window xid.

Definition at line 482 of file launcher.py.

00482 
00483     def get_icon_by_window_xid(self, xid):
00484         """Gets a launcher icon that controls the specified window xid."""
00485         icons = [i for i in self.get_children_by_type(SimpleLauncherIcon) if i.xids.contains(xid)]
00486         if (len(icons)):
00487             return icons[0]
00488 
00489         return None

Get a list of icons that satisfy the given filters.

For example:

>>> get_icons_by_filter(tooltip_text="My Application")
... [...]

Returns an empty list if no icons matched the filter.

Definition at line 490 of file launcher.py.

00490 
00491     def get_icons_by_filter(self, **kwargs):
00492         """Get a list of icons that satisfy the given filters.
00493 
00494         For example:
00495 
00496         >>> get_icons_by_filter(tooltip_text="My Application")
00497         ... [...]
00498 
00499         Returns an empty list if no icons matched the filter.
00500 
00501         """
00502         return self.get_children_by_type(SimpleLauncherIcon, **kwargs)

def unity.emulators.launcher.LauncherModel.get_launcher_icons (   self,
  visible_only = True 
)
Get a list of launcher icons in this launcher.

Definition at line 438 of file launcher.py.

00438 
00439     def get_launcher_icons(self, visible_only=True):
00440         """Get a list of launcher icons in this launcher."""
00441         if visible_only:
00442             return self.get_children_by_type(SimpleLauncherIcon, visible=True)
00443         else:
00444             return self.get_children_by_type(SimpleLauncherIcon)

Here is the caller graph for this function:

def unity.emulators.launcher.LauncherModel.get_launcher_icons_for_monitor (   self,
  monitor,
  visible_only = True 
)
Get a list of launcher icons for provided monitor.

Definition at line 452 of file launcher.py.

00452 
00453     def get_launcher_icons_for_monitor(self, monitor, visible_only=True):
00454         """Get a list of launcher icons for provided monitor."""
00455         icons = []
00456         for icon in self.get_launcher_icons(visible_only):
00457             if icon.is_on_monitor(monitor):
00458                 icons.append(icon)
00459 
00460         return icons

Here is the call graph for this function:

def unity.emulators.launcher.LauncherModel.num_bamf_launcher_icons (   self,
  visible_only = True 
)
Get the number of bamf icons in the launcher model.

Definition at line 507 of file launcher.py.

00507 
00508     def num_bamf_launcher_icons(self, visible_only=True):
00509         """Get the number of bamf icons in the launcher model."""
00510         return len(self.get_bamf_launcher_icons(visible_only))

Here is the call graph for this function:

Get the number of icons in the launcher model.

Definition at line 503 of file launcher.py.

00503 
00504     def num_launcher_icons(self):
00505         """Get the number of icons in the launcher model."""
00506         return len(self.get_launcher_icons())

Here is the call graph for this function:


Member Data Documentation

string unity.emulators.UnityIntrospectionObject.DBUS_OBJECT = "/com/canonical/Unity/Debug" [static, inherited]

Definition at line 19 of file __init__.py.

string unity.emulators.UnityIntrospectionObject.DBUS_SERVICE = "com.canonical.Unity" [static, inherited]

Definition at line 18 of file __init__.py.


The documentation for this class was generated from the following file: