Esempio n. 1
0
ItemIterator Connection::GetDirectory(const std::string &directory)
{
	prechecksNoCommandsList();
	mpd_send_list_meta(m_connection.get(), directory.c_str());
	checkErrors();
	return ItemIterator(m_connection.get(), defaultFetcher<Item>(mpd_recv_entity));
}
Esempio n. 2
0
MenuItem*
Menu::FindMarked()
{
	MenuItemIterator iterator = ItemIterator();
	while (MenuItem* item = iterator.Next()) {
		if (item->IsMarked())
			return item;
	}

	return NULL;
}
Esempio n. 3
0
MenuItem*
Menu::FindItem(const char* label)
{
	MenuItemIterator iterator = ItemIterator();
	while (MenuItem* item = iterator.Next()) {
		if (item->Label() != NULL && !strcmp(item->Label(), label))
			return item;
	}

	return NULL;
}
Esempio n. 4
0
MenuItem*
Menu::FindItemByShortcut(char key)
{
	if (key == 0)
		return NULL;

	MenuItemList::Iterator iterator = ItemIterator();
	while (MenuItem* item = iterator.Next()) {
		if (item->Shortcut() == key)
			return item;
	}

	return NULL;
}
Esempio n. 5
0
int32
Menu::IndexOf(MenuItem* searchedItem)
{
	int32 index = 0;

	MenuItemIterator iterator = ItemIterator();
	while (MenuItem* item = iterator.Next()) {
		if (item == searchedItem)
			return index;

		index++;
	}

	return -1;
}
Esempio n. 6
0
MenuItem *
Menu::ItemAt(int32 index)
{
    if (index < 0 || index >= fCount)
        return NULL;

    MenuItemIterator iterator = ItemIterator();
    MenuItem *item;

    while ((item = iterator.Next()) != NULL) {
        if (index-- == 0)
            return item;
    }

    return NULL;
}
Esempio n. 7
0
MenuItem*
Menu::RemoveItemAt(int32 index)
{
	if (index < 0 || index >= fCount)
		return NULL;

	MenuItemIterator iterator = ItemIterator();
	while (MenuItem* item = iterator.Next()) {
		if (index-- == 0) {
			RemoveItem(item);
			return item;
		}
	}

	return NULL;
}
Esempio n. 8
0
MenuItem*
Menu::FindSelected(int32* _index)
{
	int32 index = 0;

	MenuItemIterator iterator = ItemIterator();
	while (MenuItem* item = iterator.Next()) {
		if (item->IsSelected()) {
			if (_index != NULL)
				*_index = index;
			return item;
		}

		index++;
	}

	return NULL;
}
Esempio n. 9
0
MenuItem*
Menu::FindItemByShortcut(char key)
{
	if (key == 0)
		return NULL;

	MenuItemList::Iterator iterator = ItemIterator();
	while (MenuItem* item = iterator.Next()) {
		if (item->Shortcut() == key)
			return item;
	}

	Menu *superMenu = Supermenu();

	if (superMenu != NULL)
		return superMenu->FindItemByShortcut(key);

	return NULL;
}
Esempio n. 10
0
ItemIterator Invoice::create_iterator()
{  
   return ItemIterator(items);
}