nsresult
nsListCommand::ToggleState(nsIEditor *aEditor)
{
  nsCOMPtr<nsIHTMLEditor> editor = do_QueryInterface(aEditor);
  NS_ENSURE_TRUE(editor, NS_NOINTERFACE);

  nsresult rv;
  nsCOMPtr<nsICommandParams> params =
      do_CreateInstance(NS_COMMAND_PARAMS_CONTRACTID,&rv);
  if (NS_FAILED(rv) || !params)
    return rv;

  rv = GetCurrentState(aEditor, params);
  NS_ENSURE_SUCCESS(rv, rv);

  bool inList;
  rv = params->GetBooleanValue(STATE_ALL,&inList);
  NS_ENSURE_SUCCESS(rv, rv);

  nsDependentAtomString listType(mTagName);
  if (inList) {
    rv = editor->RemoveList(listType);
  } else {
    rv = editor->MakeOrChangeList(listType, false, EmptyString());
  }

  return rv;
}
// -----------------------------------------------------------------------------
// CPIMLocalizationData::ConstructFromResourceL
// -----------------------------------------------------------------------------
//
void CPIMLocalizationData::ConstructFromResourceL(
    RResourceFile& aResourceFile,
    TResourceReader& aReader)
{
    TInt listCount(aReader.ReadInt16());

    __ASSERT_DEBUG(listCount > iSubType,
                   User::Panic(KPIMPanicCategory, EPIMPanicGeneral));

    // Find the correct resource structure for the requested sub-type. If
    // the list type is incorrect the reader skips the incorrect resource
    // structure and tries the next one until no lists can be processed.
    for (TInt i(1); i <= listCount; i++)
    {
        TInt listType(aReader.ReadInt8());
        if (listType == iSubType)
        {
            ReadListInfoFromResourceL(aResourceFile, aReader);
            break;
        }
        else if (i < listCount)
        {
            // Advance in resource file since this wasn't the list which
            // was requested. Currently there are three LLINK:s to skip
            aReader.Advance(sizeof(TInt32) * KPIMNumListResourceLinks);
        }
    }
}
Пример #3
0
	void AssetManager::list_f(const CmdArgs& param) {
		SCOPE_LOCK;

		int type = 0;
		if (param.tokened.size() > 1)
			type = atoi(param.tokened[1].c_str());

		listType(type, nullptr);
	}
Пример #4
0
CompOption::Value::operator Type ()
{
    return listType ();
}
Пример #5
0
	void AssetManager::matlist_f(const CmdArgs& param) {
		listType(Asset::kMaterial, nullptr);
	}