Back to index

unity  6.0.0
Public Types | Public Member Functions | Private Attributes
unity::indicator::Indicators::Impl Class Reference
Collaboration diagram for unity::indicator::Indicators::Impl:
Collaboration graph
[legend]

List of all members.

Public Types

typedef std::map< std::string,
Indicator::Ptr
IndicatorMap
typedef std::map< std::string,
Entry::Ptr
EntryMap

Public Member Functions

 Impl (Indicators *owner)
void ActivateEntry (std::string const &entry_id, nux::Rect const &geometry)
void SetEntryShowNow (std::string const &entry_id, bool show_now)
IndicatorsList GetIndicators () const
Indicator::Ptr GetIndicator (std::string const &name)
Indicator::Ptr AddIndicator (std::string const &name)
void RemoveIndicator (std::string const &name)
void OnEntryAdded (Entry::Ptr const &entry)
Entry::Ptr GetEntry (std::string const &entry_id)

Private Attributes

Indicatorsowner_
IndicatorMap indicators_
Entry::Ptr active_entry_

Detailed Description

Definition at line 29 of file Indicators.cpp.


Member Typedef Documentation

Definition at line 33 of file Indicators.cpp.

Definition at line 32 of file Indicators.cpp.


Constructor & Destructor Documentation

Definition at line 35 of file Indicators.cpp.

    : owner_(owner)
  {}

Member Function Documentation

void unity::indicator::Indicators::Impl::ActivateEntry ( std::string const &  entry_id,
nux::Rect const &  geometry 
)

Definition at line 96 of file Indicators.cpp.

{
  if (active_entry_)
  {
    active_entry_->set_geometry(nux::Rect());
    active_entry_->set_active(false);
  }

  active_entry_ = GetEntry(entry_id);

  if (active_entry_)
  {
    active_entry_->set_geometry(geometry);
    active_entry_->set_active(true);
    owner_->on_entry_activated.emit(entry_id, geometry);
  }
  else
  {
    owner_->on_entry_activated.emit(std::string(), nux::Rect());
  }
}

Here is the call graph for this function:

Definition at line 140 of file Indicators.cpp.

{
  Indicator::Ptr indicator(GetIndicator(name));

  if (indicator)
    return indicator;

  if (name == "libappmenu.so")
  {
    auto appmenu = std::make_shared<AppmenuIndicator>(name);
    appmenu->on_show_appmenu.connect(sigc::mem_fun(owner_, &Indicators::OnShowAppMenu));
    indicator = appmenu;
  }
  else
  {
    indicator = std::make_shared<Indicator>(name);
  }

  // The owner Indicators class is interested in the other events.
  indicator->on_show_menu.connect(sigc::mem_fun(owner_, &Indicators::OnEntryShowMenu));
  indicator->on_secondary_activate.connect(sigc::mem_fun(owner_, &Indicators::OnEntrySecondaryActivate));
  indicator->on_scroll.connect(sigc::mem_fun(owner_, &Indicators::OnEntryScroll));

  indicators_[name] = indicator;
  owner_->on_object_added.emit(indicator);

  return indicator;
}

Here is the call graph for this function:

Entry::Ptr unity::indicator::Indicators::Impl::GetEntry ( std::string const &  entry_id)

Definition at line 189 of file Indicators.cpp.

{
  for (auto it = indicators_.begin(); it != indicators_.end(); ++it)
  {
    Entry::Ptr entry = it->second->GetEntry(entry_id);

    if (entry)
      return entry;
  }

  return Entry::Ptr();
}

Here is the caller graph for this function:

Definition at line 169 of file Indicators.cpp.

{
  IndicatorMap::iterator i = indicators_.find(name);
  if (i != indicators_.end())
    return i->second;

  return Indicator::Ptr();
}

Definition at line 128 of file Indicators.cpp.

{
  Indicators::IndicatorsList list;

  for (auto it = indicators_.begin(); it != indicators_.end(); it++)
  {
    list.push_back(it->second);
  }

  return list;
}
void unity::indicator::Indicators::Impl::RemoveIndicator ( std::string const &  name)

Definition at line 178 of file Indicators.cpp.

{
  auto indicator = GetIndicator(name);

  if (indicator)
  {
    owner_->on_object_removed.emit(indicator);
    indicators_.erase(name);
  }
}

Here is the call graph for this function:

void unity::indicator::Indicators::Impl::SetEntryShowNow ( std::string const &  entry_id,
bool  show_now 
)

Definition at line 118 of file Indicators.cpp.

{
  Entry::Ptr entry = GetEntry(entry_id);
  if (entry)
  {
    entry->set_show_now(show_now);
  }
}

Member Data Documentation

Definition at line 55 of file Indicators.cpp.

Definition at line 54 of file Indicators.cpp.

Definition at line 53 of file Indicators.cpp.


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