Пример #1
0
WebpPlugin::Capabilities WebpPlugin::capabilities ( QIODevice * device, const QByteArray & format ) const {
	Q_UNUSED(device);

    if(format == "webp"){
        return Capabilities(CanRead | CanWrite);
    }
    return Capabilities();    
}
Пример #2
0
QImageIOPlugin::Capabilities XimgPlugin::capabilities( QIODevice * a_pDevice, QByteArray const & a_Format ) const
{
    if ( a_pDevice->isOpen() && a_pDevice->isReadable() )
    {
        if ( XimgHandler::canRead( a_pDevice ) )
            return Capabilities( CanRead );
    }
    else
    {
        if ( ( a_Format == "ximg" ) || ( a_Format == "_ximg" ) )
            return Capabilities( CanRead );
    }
    return 0;
}
Пример #3
0
QImageIOPlugin::Capabilities DdsPlugin::capabilities( QIODevice * a_pDevice, QByteArray const & a_Format ) const
{
    if ( a_pDevice->isOpen() && a_pDevice->isReadable() )
    {
        if ( DdsHandler::canRead( a_pDevice ) )
            return Capabilities( CanRead );
    }
    else
    {
        if ( a_Format == "dds" )
            return Capabilities( CanRead );
    }
    return 0;
}
Пример #4
0
QImageIOPlugin::Capabilities
RawPlugin::capabilities(QIODevice *device, const QByteArray &format) const
{
    if (keys().contains(format) ||
        format == "tif" ||
        format == "tiff")
        return Capabilities(CanRead);
    if (!format.isEmpty())
        return 0;

    Capabilities cap;
    if (device->isReadable())
        cap |= CanRead;
    return Capabilities(CanRead);
}
Пример #5
0
QImageIOPlugin::Capabilities QSvgPlugin::capabilities(QIODevice *device, const QByteArray &format) const
{
    if (format == "svg" || format == "svgz")
        return Capabilities(CanRead);
    if (!format.isEmpty())
        return 0;

    Capabilities cap;
    if (device->isReadable() && QSvgIOHandler::canRead(device))
        cap |= CanRead;
    return cap;
}
Пример #6
0
QImageIOPlugin::Capabilities QTgaPlugin::capabilities(QIODevice *device, const QByteArray &format) const
{
    if (format == "tga")
        return Capabilities(CanRead);
    if (!format.isEmpty())
        return 0;
    if (!device->isOpen())
        return 0;

    Capabilities cap;
    if (device->isReadable() && QTgaHandler::canRead(device))
        cap |= CanRead;
    return cap;
}
Пример #7
0
status_t
Protocol::GetQuota(uint64& used, uint64& total)
{
	if (!Capabilities().Contains("QUOTA"))
		return B_ERROR;

	GetQuotaCommand quotaCommand;
	status_t status = ProcessCommand(quotaCommand);
	if (status != B_OK)
		return status;

	used = quotaCommand.UsedStorage();
	total = quotaCommand.TotalStorage();
	return B_OK;
}
Пример #8
0
QImageIOPlugin::Capabilities QDDSPlugin::capabilities(QIODevice *device, const QByteArray &format) const
{
    if (format == QByteArrayLiteral("dds"))
        return Capabilities(CanRead | CanWrite);
    if (!format.isEmpty())
        return 0;
    if (!device || !device->isOpen())
        return 0;

    Capabilities cap;
    if (device->isReadable() && QDDSHandler::canRead(device))
        cap |= CanRead;
    if (device->isWritable())
        cap |= CanWrite;
    return cap;
}
Пример #9
0
QImageIOPlugin::Capabilities QPsdPlugin::capabilities(QIODevice *device, const QByteArray &format) const
{
    if (format == "psd" || format == "psd")
        return Capabilities(CanRead /*| CanWrite*/);
    if (!format.isEmpty())
        return 0;
    if (!device->isOpen())
        return 0;

    Capabilities cap;
    if (device->isReadable() && QPsdHandler::canRead(device))
        cap |= CanRead;
    //if (device->isWritable())
    //    cap |= CanWrite;
    return cap;
}
Пример #10
0
QImageIOPlugin::Capabilities QJpegPlugin::capabilities(QIODevice *device, const QByteArray &format) const
{
    if (format == "jpeg" || format == "jpg")
        return Capabilities(CanRead | CanWrite);
    if (!format.isEmpty())
        return 0;
    if (!device->isOpen())
        return 0;

    Capabilities cap;
    if (device->isReadable() && QJpegHandler::canRead(device))
        cap |= CanRead;
    if (device->isWritable())
        cap |= CanWrite;
    return cap;
}
Пример #11
0
QImageIOPlugin::Capabilities EPSPlugin::capabilities(QIODevice *device, const QByteArray &format) const
{
    if (format == "eps" || format == "epsi" || format == "EPS" || format == "EPSI" ||
        format == "epsf" || format == "EPSF")
        return Capabilities(CanRead | CanWrite);
    if (!format.isEmpty())
        return 0;
    if (!device->isOpen())
        return 0;

    Capabilities cap;
    if (device->isReadable() && EPSHandler::canRead(device))
        cap |= CanRead;
    if (device->isWritable())
        cap |= CanWrite;
    return cap;
}
Пример #12
0
QT_BEGIN_NAMESPACE

QImageIOPlugin::Capabilities QICOPlugin::capabilities(QIODevice *device, const QByteArray &format) const
{
    if (format == "ico")
        return Capabilities(CanRead | CanWrite);
    if (!format.isEmpty())
        return 0;
    if (!device->isOpen())
        return 0;

    Capabilities cap;
    if (device->isReadable() && QtIcoHandler::canRead(device))
        cap |= CanRead;
    if (device->isWritable())
        cap |= CanWrite;
    return cap;
}
Пример #13
0
QImageIOPlugin::Capabilities QtJP2Plugin::capabilities(QIODevice* device, const QByteArray& format) const
{
  if (format == "jp2" || format == "j2k")
    return Capabilities(CanRead | CanWrite);

  if (!format.isEmpty())
    return 0;

  if (!device->isOpen())
    return 0;

  Capabilities caps;
  if (device->isReadable() && (QtJP2OpenJPEGImageHandler::canRead(device) != CODEC_UNKNOWN))
    caps |= CanRead;

  if (device->isWritable())
    caps |= CanWrite;

  return caps;
}
Пример #14
0
ImageIOHandlerPlugin::Capabilities DefaultHandlerPlugin::capabilities(QIODevice *device, const QMimeType &mimeType) const
{
    Q_UNUSED(device);
    Q_UNUSED(mimeType);
    return Capabilities(CanRead | CanWrite);
}
Пример #15
0
QImageIOPlugin::Capabilities vlcdump::capabilities( QIODevice *device, const QByteArray &format ) const{
	if( format == "dump" )
		return Capabilities( CanRead );
	else
		return 0;
}
Пример #16
0
status_t
Protocol::Connect(const BNetworkAddress& address, const char* username,
	const char* password, bool useSSL)
{
	TRACE("Connect\n");
	if (useSSL)
		fSocket = new(std::nothrow) BSecureSocket(address);
	else
		fSocket = new(std::nothrow) BSocket(address);

	if (fSocket == NULL)
		return B_NO_MEMORY;

	status_t status = fSocket->InitCheck();
	if (status != B_OK)
		return status;

	fBufferedSocket = new(std::nothrow) BBufferedDataIO(*fSocket, 32768, false,
		true);
	if (fBufferedSocket == NULL)
		return B_NO_MEMORY;

	TRACE("Login\n");

	fIsConnected = true;

	LoginCommand login(username, password);
	status = ProcessCommand(login);
	if (status != B_OK) {
		_Disconnect();
		return status;
	}

	_ParseCapabilities(login.Capabilities());

	if (fCapabilities.IsEmpty()) {
		CapabilityHandler capabilityHandler;
		status = ProcessCommand(capabilityHandler);
		if (status != B_OK)
			return status;

		_ParseCapabilities(capabilityHandler.Capabilities());
	}

	if (Capabilities().Contains("ID")) {
		// Get the server's ID into our log
		class IDCommand : public IMAP::Command, public IMAP::Handler {
		public:
			BString CommandString()
			{
				return "ID NIL";
			}

			bool HandleUntagged(IMAP::Response& response)
			{
				if (response.IsCommand("ID") && response.IsListAt(1)) {
					puts("Server:");
					ArgumentList& list = response.ListAt(1);
					for (int32 i = 0; i < list.CountItems(); i += 2) {
						printf("  %s: %s\n",
							list.ItemAt(i)->ToString().String(),
							list.ItemAt(i + 1)->ToString().String());
					}
					return true;
				}

				return false;
			}
		};
		IDCommand idCommand;
		ProcessCommand(idCommand);
	}
	return B_OK;
}
Пример #17
0
QImageIOPlugin::Capabilities QGifPlugin::capabilities(QIODevice *device, const QByteArray &format) const
{
    if (format == "gif" || (device && device->isReadable() && QGifHandler::canRead(device)))
        return Capabilities(CanRead);
    return 0;
}
Пример #18
0
  const Tuint08 uiFileSpace[14] PROGMEM = { FileSpace(VN_00),FileSpace(VN_01),FileSpace(VN_02),FileSpace(VN_03),FileSpace(VN_04),FileSpace(VN_05),FileSpace(VN_06),FileSpace(VN_07),FileSpace(VN_08),FileSpace(VN_09),FileSpace(VN_10),FileSpace(VN_11),FileSpace(VN_12),FileSpace(VN_13) };
#elif defFsNumberOfPreFiles == 15
  const Tuint08 uiFileSpace[15] PROGMEM = { FileSpace(VN_00),FileSpace(VN_01),FileSpace(VN_02),FileSpace(VN_03),FileSpace(VN_04),FileSpace(VN_05),FileSpace(VN_06),FileSpace(VN_07),FileSpace(VN_08),FileSpace(VN_09),FileSpace(VN_10),FileSpace(VN_11),FileSpace(VN_12),FileSpace(VN_13),FileSpace(VN_14) };
#elif defFsNumberOfPreFiles == 16
  const Tuint08 uiFileSpace[16] PROGMEM = { FileSpace(VN_00),FileSpace(VN_01),FileSpace(VN_02),FileSpace(VN_03),FileSpace(VN_04),FileSpace(VN_05),FileSpace(VN_06),FileSpace(VN_07),FileSpace(VN_08),FileSpace(VN_09),FileSpace(VN_10),FileSpace(VN_11),FileSpace(VN_12),FileSpace(VN_13),FileSpace(VN_14),FileSpace(VN_15) };
#endif

#endif


  #if (cfgCheckMethodUse == cfgTrue) && (defCapabilitiesFull == cfgFalse)

#if defNumberOfTasks == 0
  const Tuint08 uiCapabilities[0] PROGMEM =  { };
#elif defNumberOfTasks == 1
  const Tuint08 uiCapabilities[1] PROGMEM =  { (Capabilities(TN_00) & 0xFF) };
#elif defNumberOfTasks == 2
  const Tuint08 uiCapabilities[2] PROGMEM =  { (Capabilities(TN_00) & 0xFF),(Capabilities(TN_01) & 0xFF) };
#elif defNumberOfTasks == 3
  const Tuint08 uiCapabilities[3] PROGMEM =  { (Capabilities(TN_00) & 0xFF),(Capabilities(TN_01) & 0xFF),(Capabilities(TN_02) & 0xFF) };
#elif defNumberOfTasks == 4
  const Tuint08 uiCapabilities[4] PROGMEM =  { (Capabilities(TN_00) & 0xFF),(Capabilities(TN_01) & 0xFF),(Capabilities(TN_02) & 0xFF),(Capabilities(TN_03) & 0xFF) };
#elif defNumberOfTasks == 5
  const Tuint08 uiCapabilities[5] PROGMEM =  { (Capabilities(TN_00) & 0xFF),(Capabilities(TN_01) & 0xFF),(Capabilities(TN_02) & 0xFF),(Capabilities(TN_03) & 0xFF),(Capabilities(TN_04) & 0xFF) };
#elif defNumberOfTasks == 6
  const Tuint08 uiCapabilities[6] PROGMEM =  { (Capabilities(TN_00) & 0xFF),(Capabilities(TN_01) & 0xFF),(Capabilities(TN_02) & 0xFF),(Capabilities(TN_03) & 0xFF),(Capabilities(TN_04) & 0xFF),(Capabilities(TN_05) & 0xFF) };
#elif defNumberOfTasks == 7
  const Tuint08 uiCapabilities[7] PROGMEM =  { (Capabilities(TN_00) & 0xFF),(Capabilities(TN_01) & 0xFF),(Capabilities(TN_02) & 0xFF),(Capabilities(TN_03) & 0xFF),(Capabilities(TN_04) & 0xFF),(Capabilities(TN_05) & 0xFF),(Capabilities(TN_06) & 0xFF) };
#elif defNumberOfTasks == 8
  const Tuint08 uiCapabilities[8] PROGMEM =  { (Capabilities(TN_00) & 0xFF),(Capabilities(TN_01) & 0xFF),(Capabilities(TN_02) & 0xFF),(Capabilities(TN_03) & 0xFF),(Capabilities(TN_04) & 0xFF),(Capabilities(TN_05) & 0xFF),(Capabilities(TN_06) & 0xFF),(Capabilities(TN_07) & 0xFF) };
#elif defNumberOfTasks == 9
Пример #19
0
QImageIOPlugin::Capabilities FlifPlugin::capabilities( QIODevice*, const QByteArray &format ) const {
    if( format == "flif" )
        return Capabilities( CanRead | CanWrite );
    else
        return 0;
}