// Path: src/com/android/ddmuilib/logcat/LogPanel.java
// protected static class LogMessage {
//     public LogMessageInfo data;
//     public String msg;
// 
//     @Override
//     public String toString() {
//         return data.time + ": " //$NON-NLS-1$
//             + data.logLevel + "/" //$NON-NLS-1$
//             + data.tag + "(" //$NON-NLS-1$
//             + data.pidString + "): " //$NON-NLS-1$
//             + msg;
//     }
// }


import com.android.ddmlib.Log;
import com.android.ddmlib.Log.LogLevel;
import com.android.ddmuilib.annotation.UiThread;
import com.android.ddmuilib.logcat.LogPanel.LogMessage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTException;
import org.eclipse.swt.widgets.ScrollBar;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;
import java.util.ArrayList;
import java.util.regex.PatternSyntaxException;
/*
 * Copyright (C) 2007 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.ddmuilib.logcat;




/** logcat output filter class */
public class LogFilter {

    public final static int MODE_PID = 0x01;
    public final static int MODE_TAG = 0x02;
    public final static int MODE_LEVEL = 0x04;

    private String mName;

    /**
     * Filtering mode. Value can be a mix of MODE_PID, MODE_TAG, MODE_LEVEL
     */
    private int mMode = 0;

    /**
     * pid used for filtering. Only valid if mMode is MODE_PID.
     */
    private int mPid;

    /** Single level log level as defined in Log.mLevelChar. Only valid
     * if mMode is MODE_LEVEL */
    private int mLogLevel;

    /**
     * log tag filtering. Only valid if mMode is MODE_TAG
     */
    private String mTag;

    private Table mTable;
    private TabItem mTabItem;
    private boolean mIsCurrentTabItem = false;
    private int mUnreadCount = 0;

    /** Temp keyword filtering */
    private String[] mTempKeywordFilters;

    /** temp pid filtering */
    private int mTempPid = -1;

    /** temp tag filtering */
    private String mTempTag;

    /** temp log level filtering */
    private int mTempLogLevel = -1;

    private LogColors mColors;

    private boolean mTempFilteringStatus = false;

// Path: src/com/android/ddmuilib/logcat/LogPanel.java
// protected static class LogMessage {
//     public LogMessageInfo data;
//     public String msg;
// 
//     @Override
//     public String toString() {
//         return data.time + ": " //$NON-NLS-1$
//             + data.logLevel + "/" //$NON-NLS-1$
//             + data.tag + "(" //$NON-NLS-1$
//             + data.pidString + "): " //$NON-NLS-1$
//             + msg;
//     }
// }


// Path: src/com/android/ddmuilib/logcat/LogFilter.java
import com.android.ddmlib.Log;
import com.android.ddmlib.Log.LogLevel;
import com.android.ddmuilib.annotation.UiThread;
import com.android.ddmuilib.logcat.LogPanel.LogMessage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTException;
import org.eclipse.swt.widgets.ScrollBar;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;
import java.util.ArrayList;
import java.util.regex.PatternSyntaxException;

/*
 * Copyright (C) 2007 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.ddmuilib.logcat;




/** logcat output filter class */
public class LogFilter {

    public final static int MODE_PID = 0x01;
    public final static int MODE_TAG = 0x02;
    public final static int MODE_LEVEL = 0x04;

    private String mName;

    /**
     * Filtering mode. Value can be a mix of MODE_PID, MODE_TAG, MODE_LEVEL
     */
    private int mMode = 0;

    /**
     * pid used for filtering. Only valid if mMode is MODE_PID.
     */
    private int mPid;

    /** Single level log level as defined in Log.mLevelChar. Only valid
     * if mMode is MODE_LEVEL */
    private int mLogLevel;

    /**
     * log tag filtering. Only valid if mMode is MODE_TAG
     */
    private String mTag;

    private Table mTable;
    private TabItem mTabItem;
    private boolean mIsCurrentTabItem = false;
    private int mUnreadCount = 0;

    /** Temp keyword filtering */
    private String[] mTempKeywordFilters;

    /** temp pid filtering */
    private int mTempPid = -1;

    /** temp tag filtering */
    private String mTempTag;

    /** temp log level filtering */
    private int mTempLogLevel = -1;

    private LogColors mColors;

    private boolean mTempFilteringStatus = false;

    private final ArrayList<LogMessage> mMessages = new ArrayList<LogMessage>();